public static int ketasu ( int n ) {
  if ( n >= 0 ) {
    int ketasu = 1 ;
    long jougen = 1 ;
    long base = 1 ;
    for ( int i = 0 ;
    n > jougen ;
    i ++ ) {
      ketasu = ketasu + 2 ;
      base *= 4 ;
      jougen += base ;
    }
    return ketasu ;
  }
  else {
    int ketasu = 0 ;
    long jougen = 0 ;
    long base = - 2 ;
    for ( int i = 0 ;
    n < jougen ;
    i ++ ) {
      ketasu = ketasu + 2 ;
      jougen += base ;
      base *= 4 ;
    }
    return ketasu ;
  }
}

public static int ketasu ( int n ) { if ( n >= 0 ) { int ketasu = 1 ; long jougen = 1 ; long base = 1 ; for ( int i = 0 ; n > jougen ; i ++ ) { ketasu = ketasu + 2 ; base *= 4 ; jougen += base ; } return ketasu ; } else { int ketasu = 0 ; long jougen = 0 ; long base = - 2 ; for ( int i = 0 ; n < jougen ; i ++ ) { ketasu = ketasu + 2 ; jougen += base ; base *= 4 ; } return ketasu ; } }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (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))) (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 (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (return_statement (identifier))) alternative: (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))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (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 (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))) (return_statement (identifier))))))