<awangdev>Find Peak Element_3.java
public int findPeakElement(int[] nums) {
        if (nums == null || nums.length <= 1) {
            return 0;
        }
        
        int n = nums.length;
        int start = 0;
        int end = nums.length - 1;
        int mid = 0;
        while (start <= end) {
            mid = start + (end - start) / 2;
            if ((mid - 1 < 0 || nums[mid] > nums[mid - 1]) && (mid + 1 >= n || nums[mid] > nums[mid + 1])) {
                return mid;
            } else if (mid - 1 >= 0 && nums[mid] < nums[mid - 1]) {
                end = mid - 1;
            } else {
                start = mid + 1;
            }
        }
        return mid;
    }
public int sample_funcname ( int [ ] var_0 ) {
  if ( var_0 == null || var_0 . length <= 1 ) {
    return 0 ;
  }
  int var_5 = var_0 . length ;
  int var_6 = 0 ;
  int var_7 = var_0 . length - 1 ;
  int var_8 = 0 ;
  while ( var_6 <= var_7 ) {
    var_8 = var_6 + ( var_7 - var_6 ) / 2 ;
    if ( ( var_8 - 1 < 0 || var_0 [ var_8 ] > var_0 [ var_8 - 1 ] ) && ( var_8 + 1 >= var_5 || var_0 [ var_8 ] > var_0 [ var_8 + 1 ] ) ) {
      return var_8 ;
    }
    else if ( var_8 - 1 >= 0 && var_0 [ var_8 ] < var_0 [ var_8 - 1 ] ) {
      var_7 = var_8 - 1 ;
    }
    else {
      var_6 = var_8 + 1 ;
    }
  }
  return var_8 ;
}
