comefrom: <awangdev>Search for a Range_1.java
code: public int[] searchRange(int[] A, int target) {
          int[] rst = new int[]{-1, -1};
          if (A == null || A.length == 0) {
              return rst;
          }
          int start = 0;
          int end = A.length - 1;
          int mid = start + (end - start)/2;
  
          int first = 0;
          while (start + 1 < end) {
              mid = start + (end - start)/2;
              if (A[mid] == target) {
                  if (mid - 1 >= 0 && A[mid - 1] == target) {
                      end = mid;
                      continue;
                  }
                  break;
              } else if (A[mid] < target) {
                  start = mid;
              } else {
                  end = mid;
              }
          }
          if (A[start] == target) {
              first = start;
          } else if (A[mid] == target) {
              first = mid;
          } else if (A[end] == target) {
              first = end;
          } else {
              return rst;
          }
  
          int last = first;
          start = first;
          end = A.length - 1;
          while (start + 1 < end) {
              mid = start + (end - start)/2;
              if (A[mid] == target) {
                  if (mid + 1 < A.length && A[mid + 1] == target) {
                      start = mid;
                      continue;
                  }
                  break;
              } else if (A[mid] < target) {
                  start = mid;
              } else {
                  end = mid;
              }
          }
          if (A[end] == target) {
              last = end;
          } else if (A[mid] == target) {
              last = mid;
          } else if (A[start] == target) {
              last = start;
          }
          
          rst[0] = first;
          rst[1] = last;
          
          return rst;
      }
masked: public int [ ] sample_funcname ( int [ ] var_0 , int var_1 ) {
    int [ ] var_2 = new int [ ] {
      - 1 , - 1 };
      if ( var_0 == null || var_0 . length == 0 ) {
        return var_2 ;
      }
      int var_3 = 0 ;
      int var_4 = var_0 . length - 1 ;
      int var_5 = var_3 + ( var_4 - var_3 ) / 2 ;
      int var_6 = 0 ;
      while ( var_3 + 1 < var_4 ) {
        var_5 = var_3 + ( var_4 - var_3 ) / 2 ;
        if ( var_0 [ var_5 ] == var_1 ) {
          if ( var_5 - 1 >= 0 && var_0 [ var_5 - 1 ] == var_1 ) {
            var_4 = var_5 ;
            continue ;
          }
          break ;
        }
        else if ( var_0 [ var_5 ] < var_1 ) {
          var_3 = var_5 ;
        }
        else {
          var_4 = var_5 ;
        }
      }
      if ( var_0 [ var_3 ] == var_1 ) {
        var_6 = var_3 ;
      }
      else if ( var_0 [ var_5 ] == var_1 ) {
        var_6 = var_5 ;
      }
      else if ( var_0 [ var_4 ] == var_1 ) {
        var_6 = var_4 ;
      }
      else {
        return var_2 ;
      }
      int var_7 = var_6 ;
      var_3 = var_6 ;
      var_4 = var_0 . length - 1 ;
      while ( var_3 + 1 < var_4 ) {
        var_5 = var_3 + ( var_4 - var_3 ) / 2 ;
        if ( var_0 [ var_5 ] == var_1 ) {
          if ( var_5 + 1 < var_0 . length && var_0 [ var_5 + 1 ] == var_1 ) {
            var_3 = var_5 ;
            continue ;
          }
          break ;
        }
        else if ( var_0 [ var_5 ] < var_1 ) {
          var_3 = var_5 ;
        }
        else {
          var_4 = var_5 ;
        }
      }
      if ( var_0 [ var_4 ] == var_1 ) {
        var_7 = var_4 ;
      }
      else if ( var_0 [ var_5 ] == var_1 ) {
        var_7 = var_5 ;
      }
      else if ( var_0 [ var_3 ] == var_1 ) {
        var_7 = var_3 ;
      }
      var_2 [ 0 ] = var_6 ;
      var_2 [ 1 ] = var_7 ;
      return var_2 ;
    }
    