comefrom: <gouthampradhan>dynamic_programming_NonNegativeIntegersWithoutConsecutiveOnes_1.java
code: public int findIntegers(int num) {
      int msbIndex = 0;
      for (int i = 0; i < 31; i++) {
        if (((1 << i) & num) > 0) {
          msbIndex = i;
        }
      }
      int[][] DP1 = new int[2][msbIndex + 1]; 
      int[][] DP2 = new int[2][msbIndex + 2]; 
      for (int i = msbIndex; i >= 0; i--) {
        if (i == msbIndex) {
          DP1[0][msbIndex] = 1;
          DP1[1][msbIndex] = 1;
        } else {
          DP1[0][i] = DP1[0][i + 1] + DP1[1][i + 1];
          DP1[1][i] = DP1[0][i + 1];
        }
      }
      int[] bits = new int[msbIndex + 1];
      boolean bitFlipped = false;
      for (int i = msbIndex, j = 0; i >= 0; i--, j++) {
        if (j == 0) {
          bits[j] = 1;
        } else {
          if (bitFlipped) {
            bits[j] = bits[j - 1] == 0 ? 1 : 0;
          } else {
            if (((1 << i) & num) > 0) {
              if (bits[j - 1] > 0) {
                bits[j] = 0;
                bitFlipped = true;
              } else bits[j] = 1;
            }
          }
        }
      }
      DP2[0][msbIndex + 1] = 1;
      for (int i = bits.length - 1; i >= 0; i--) {
        if (bits[i] == 0) {
          DP2[0][i] = DP2[0][i + 1] + DP2[1][i + 1];
          if (bits[i - 1] == 0) {
            DP2[1][i] = (i == bits.length - 1) ? 1 : DP1[0][i + 1];
          }
        } else {
          DP2[1][i] = DP2[0][i + 1];
        }
      }
      return (DP1[0][0] + DP1[1][0]) - (DP2[0][0] + DP2[1][0]) + 1;
    }
masked: public int sample_funcname ( int var_0 ) {
    int var_1 = 0 ;
    for ( int var_2 = 0 ;
    var_2 < 31 ;
    var_2 ++ ) {
      if ( ( ( 1 << var_2 ) & var_0 ) > 0 ) {
        var_1 = var_2 ;
      }
    }
    int [ ] [ ] var_3 = new int [ 2 ] [ var_1 + 1 ] ;
    int [ ] [ ] var_4 = new int [ 2 ] [ var_1 + 2 ] ;
    for ( int var_2 = var_1 ;
    var_2 >= 0 ;
    var_2 -- ) {
      if ( var_2 == var_1 ) {
        var_3 [ 0 ] [ var_1 ] = 1 ;
        var_3 [ 1 ] [ var_1 ] = 1 ;
      }
      else {
        var_3 [ 0 ] [ var_2 ] = var_3 [ 0 ] [ var_2 + 1 ] + var_3 [ 1 ] [ var_2 + 1 ] ;
        var_3 [ 1 ] [ var_2 ] = var_3 [ 0 ] [ var_2 + 1 ] ;
      }
    }
    int [ ] var_5 = new int [ var_1 + 1 ] ;
    boolean var_7 = false ;
    for ( int var_2 = var_1 , var_6 = 0 ;
    var_2 >= 0 ;
    var_2 -- , var_6 ++ ) {
      if ( var_6 == 0 ) {
        var_5 [ var_6 ] = 1 ;
      }
      else {
        if ( var_7 ) {
          var_5 [ var_6 ] = var_5 [ var_6 - 1 ] == 0 ? 1 : 0 ;
        }
        else {
          if ( ( ( 1 << var_2 ) & var_0 ) > 0 ) {
            if ( var_5 [ var_6 - 1 ] > 0 ) {
              var_5 [ var_6 ] = 0 ;
              var_7 = true ;
            }
            else var_5 [ var_6 ] = 1 ;
          }
        }
      }
    }
    var_4 [ 0 ] [ var_1 + 1 ] = 1 ;
    for ( int var_2 = var_5 . length - 1 ;
    var_2 >= 0 ;
    var_2 -- ) {
      if ( var_5 [ var_2 ] == 0 ) {
        var_4 [ 0 ] [ var_2 ] = var_4 [ 0 ] [ var_2 + 1 ] + var_4 [ 1 ] [ var_2 + 1 ] ;
        if ( var_5 [ var_2 - 1 ] == 0 ) {
          var_4 [ 1 ] [ var_2 ] = ( var_2 == var_5 . length - 1 ) ? 1 : var_3 [ 0 ] [ var_2 + 1 ] ;
        }
      }
      else {
        var_4 [ 1 ] [ var_2 ] = var_4 [ 0 ] [ var_2 + 1 ] ;
      }
    }
    return ( var_3 [ 0 ] [ 0 ] + var_3 [ 1 ] [ 0 ] ) - ( var_4 [ 0 ] [ 0 ] + var_4 [ 1 ] [ 0 ] ) + 1 ;
  }
  