comefrom: <gouthampradhan>binary_search_SearchForARange_1.java
code: private int findIndex(int[] nums, int target, boolean isLowerIndex) {
      int result = -1;
      int s = 0, e = nums.length - 1;
      while (s <= e) {
        int m = s + (e - s) / 2;
        if (nums[m] == target) {
          result = m;
          if (isLowerIndex)
            e = m - 1; 
          else s = m + 1;
        } else if (nums[m] < target) {
          s = m + 1;
        } else e = m - 1;
      }
      return result;
    }
masked: private int sample_funcname ( int [ ] var_0 , int var_1 , boolean var_2 ) {
    int var_3 = - 1 ;
    int var_4 = 0 , var_5 = var_0 . length - 1 ;
    while ( var_4 <= var_5 ) {
      int var_6 = var_4 + ( var_5 - var_4 ) / 2 ;
      if ( var_0 [ var_6 ] == var_1 ) {
        var_3 = var_6 ;
        if ( var_2 ) var_5 = var_6 - 1 ;
        else var_4 = var_6 + 1 ;
      }
      else if ( var_0 [ var_6 ] < var_1 ) {
        var_4 = var_6 + 1 ;
      }
      else var_5 = var_6 - 1 ;
    }
    return var_3 ;
  }
  