public static long matches ( int x ) {
  int ans = 0 ;
  int sum = 2 ;
  for ( int i = 1 ;
  i <= 30 ;
  i ++ ) {
    int y = sum - x ;
    if ( tm . containsKey ( y ) ) ans += tm . get ( y ) ;
    sum <<= 1 ;
  }
  return ans ;
}

public static long matches ( int x ) { int ans = 0 ; int sum = 2 ; for ( int i = 1 ; i <= 30 ; i ++ ) { int y = sum - x ; if ( tm . containsKey ( y ) ) ans += tm . get ( y ) ; sum <<= 1 ; } return ans ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (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: (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: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (identifier)))) (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) consequence: (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))) (return_statement (identifier))))