static int isBinPalindrome ( int x ) {
  int l = leftmostSetBit ( x ) ;
  int r = 1 ;
  while ( l > r ) {
    if ( isKthBitSet ( x , l ) != isKthBitSet ( x , r ) ) return 0 ;
    l -- ;
    r ++ ;
  }
  return 1 ;
}

static int isBinPalindrome ( int x ) { int l = leftmostSetBit ( x ) ; int r = 1 ; while ( l > r ) { if ( isKthBitSet ( x , l ) != isKthBitSet ( x , r ) ) return 0 ; l -- ; r ++ ; } return 1 ; }
(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: (method_invocation name: (identifier) arguments: (argument_list (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier))) right: (method_invocation name: (identifier) arguments: (argument_list (identifier) (identifier))))) consequence: (return_statement (decimal_integer_literal))) (expression_statement (update_expression (identifier))) (expression_statement (update_expression (identifier))))) (return_statement (decimal_integer_literal))))