static int countSubArrays ( int arr [ ] , int n ) {
  int cnt = 0 ;
  for ( int j = 0 ;
  j < n ;
  j ++ ) {
    long xorval = 0 ;
    for ( int k = j ;
    k < n ;
    k ++ ) {
      long num = 1 << arr [ k ] ;
      xorval ^= num ;
      if ( xorval == 0 || is_power_of_two ( xorval ) ) cnt ++ ;
    }
  }
  return cnt ;
}

static int countSubArrays ( int arr [ ] , int n ) { int cnt = 0 ; for ( int j = 0 ; j < n ; j ++ ) { long xorval = 0 ; for ( int k = j ; k < n ; k ++ ) { long num = 1 << arr [ k ] ; xorval ^= num ; if ( xorval == 0 || is_power_of_two ( xorval ) ) cnt ++ ; } } return cnt ; }
(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))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) 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: (decimal_integer_literal) right: (array_access array: (identifier) index: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (method_invocation name: (identifier) arguments: (argument_list (identifier))))) consequence: (expression_statement (update_expression (identifier)))))))) (return_statement (identifier))))