static long subarrayXor ( int arr [ ] , int n , int m ) {
  long ans = 0 ;
  int [ ] xorArr = new int [ n ] ;
  HashMap < Integer , Integer > mp = new HashMap < Integer , Integer > ( ) ;
  xorArr [ 0 ] = arr [ 0 ] ;
  for ( int i = 1 ;
  i < n ;
  i ++ ) xorArr [ i ] = xorArr [ i - 1 ] ^ arr [ i ] ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    int tmp = m ^ xorArr [ i ] ;
    ans = ans + ( mp . containsKey ( tmp ) == false ? 0 : ( ( long ) mp . get ( tmp ) ) ) ;
    if ( xorArr [ i ] == m ) ans ++ ;
    if ( mp . containsKey ( xorArr [ i ] ) ) mp . put ( xorArr [ i ] , mp . get ( xorArr [ i ] ) + 1 ) ;
    else mp . put ( xorArr [ i ] , 1 ) ;
  }
  return ans ;
}

static long subarrayXor ( int arr [ ] , int n , int m ) { long ans = 0 ; int [ ] xorArr = new int [ n ] ; HashMap < Integer , Integer > mp = new HashMap < Integer , Integer > ( ) ; xorArr [ 0 ] = arr [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) xorArr [ i ] = xorArr [ i - 1 ] ^ arr [ i ] ; for ( int i = 0 ; i < n ; i ++ ) { int tmp = m ^ xorArr [ i ] ; ans = ans + ( mp . containsKey ( tmp ) == false ? 0 : ( ( long ) mp . get ( tmp ) ) ) ; if ( xorArr [ i ] == m ) ans ++ ; if ( mp . containsKey ( xorArr [ i ] ) ) mp . put ( xorArr [ i ] , mp . get ( xorArr [ i ] ) + 1 ) ; else mp . put ( xorArr [ i ] , 1 ) ; } return ans ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments (type_identifier) (type_identifier))) arguments: (argument_list)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (array_access array: (identifier) index: (identifier)))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (parenthesized_expression (ternary_expression condition: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (false)) consequence: (decimal_integer_literal) alternative: (parenthesized_expression (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (identifier))) consequence: (expression_statement (update_expression (identifier)))) (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier))))) consequence: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)) (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)))) right: (decimal_integer_literal))))) alternative: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (identifier)) (decimal_integer_literal))))))) (return_statement (identifier))))