static void rotateMatrix ( int N , int mat [ ] [ ] ) {
  for ( int x = 0 ;
  x < N / 2 ;
  x ++ ) {
    for ( int y = x ;
    y < N - x - 1 ;
    y ++ ) {
      int temp = mat [ x ] [ y ] ;
      mat [ x ] [ y ] = mat [ y ] [ N - 1 - x ] ;
      mat [ y ] [ N - 1 - x ] = mat [ N - 1 - x ] [ N - 1 - y ] ;
      mat [ N - 1 - x ] [ N - 1 - y ] = mat [ N - 1 - y ] [ x ] ;
      mat [ N - 1 - y ] [ x ] = temp ;
    }
  }
}

static void rotateMatrix ( int N , int mat [ ] [ ] ) { for ( int x = 0 ; x < N / 2 ; x ++ ) { for ( int y = x ; y < N - x - 1 ; y ++ ) { int temp = mat [ x ] [ y ] ; mat [ x ] [ y ] = mat [ y ] [ N - 1 - x ] ; mat [ y ] [ N - 1 - x ] = mat [ N - 1 - x ] [ N - 1 - y ] ; mat [ N - 1 - x ] [ N - 1 - y ] = mat [ N - 1 - y ] [ x ] ; mat [ N - 1 - y ] [ x ] = temp ; } } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions))) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (array_access array: (array_access array: (identifier) index: (identifier)) index: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier))))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier))) right: (array_access array: (array_access array: (identifier) index: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier))) index: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier))))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier))) index: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier))) right: (array_access array: (array_access array: (identifier) index: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier))) index: (identifier)))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier))) index: (identifier)) right: (identifier)))))))))