code: def is_used(self, regs, i, top=None):
          
          if i < 0:
              i = 0
  
          if self.lock:
              return True
  
          regs = list(regs)  # make a copy
          if top is None:
              top = len(self)
          else:
              top -= 1
  
          for ii in range(i, top):
              for r in self.mem[ii].requires:
                  if r in regs:
                      return True
  
              for r in self.mem[ii].destroys:
                  if r in regs:
                      regs.remove(r)
  
              if not regs:
                  return False
  
          self.lock = True
          result = self.goes_requires(regs)
          self.lock = False
  
          return result
docs: Checks whether any of the given regs are required from the given point
          to the end or not.