<awangdev>152. Maximum Product Subarray_4.java
int maxProduct(int nums[]) {
        int max = nums[0];

        for (int i = 1, imax = max, imin = max; i < nums.length; i++) {
            if (nums[i] < 0) {
                int temp = imax;
                imax = imin;
                imin = temp;
            }

            imax = Math.max(nums[i], imax * nums[i]);
            imin = Math.min(nums[i], imin * nums[i]);

            max = Math.max(max, imax);
        }
        return max;
    }
int sample_funcname ( int var_0 [ ] ) {
  int max = var_0 [ 0 ] ;
  for ( int var_4 = 1 , var_5 = max , var_6 = max ;
  var_4 < var_0 . length ;
  var_4 ++ ) {
    if ( var_0 [ var_4 ] < 0 ) {
      int var_8 = var_5 ;
      var_5 = var_6 ;
      var_6 = var_8 ;
    }
    var_5 = Math . max ( var_0 [ var_4 ] , var_5 * var_0 [ var_4 ] ) ;
    var_6 = Math . min ( var_0 [ var_4 ] , var_6 * var_0 [ var_4 ] ) ;
    max = Math . max ( max , var_5 ) ;
  }
  return max ;
}
