code: def find_func(func_info, offset):
      """For a given offset, find the function it belongs to."""
      fidx = 0
      lidx = len(func_info) - 1
      while fidx <= lidx:
          midx = (fidx + lidx) // 2
          ms = func_info[midx]["start"]
          me = func_info[midx]["end"]
          if fidx == lidx:
              assert (
                  offset >= ms and offset <= me
              ), f"Couldn't find a function for this offset: {offset}"
              return fidx
          else:
              if offset > me:
                  fidx = midx + 1
              elif offset < ms:
                  lidx = midx - 1
              else:
                  return midx
      assert False, "Possible mismatch between model .so and LWP data"
  
file_path: tvm/python/tvm/contrib/hexagon/profiling/process_lwp_data.py
imports: import json
  import csv
  import subprocess
  import argparse
  import os
  from re import search, compile
  from collections import OrderedDict
label_desc: Use image node_id 2 for calling a global function with example usage: find_func(func_info, offset) and returns: fidx, midx