code: private boolean minimizeCost(FunctionState functionState) {
      if (!inliningLowersCost(functionState)) {
        // Try again without Block inlining references
        if (functionState.hasBlockInliningReferences()) {
          functionState.setRemove(false);
          functionState.removeBlockInliningReferences();
          if (!functionState.hasReferences() || !inliningLowersCost(functionState)) {
            return false;
          }
        } else {
          return false;
        }
      }
      return true;
    }
docs: Determines if the function is worth inlining and potentially trims references that increase the
  cost.
  
  @return Whether inlining the references lowers the overall cost.