






from __future__ import annotations



def 					_lowerCamelCase(			lowerCAmelCase__				:		Optional[int]    ,    lowerCAmelCase__				:		Any    ,    lowerCAmelCase__				:		Dict    ,    lowerCAmelCase__				:		Optional[Any]      ):





    '''simple docstring'''







    if (direction == 1 and array[indexa] > array[indexa]) or (
        direction == 0 and array[indexa] < array[indexa]
    ):
        SCREAMING_SNAKE_CASE_   :	Tuple													=   array[indexa], array[indexa]



def 					_lowerCamelCase(			lowerCAmelCase__				:		Any    ,    lowerCAmelCase__				:		str    ,    lowerCAmelCase__				:		List[str]    ,    lowerCAmelCase__				:		Any      ):





    '''simple docstring'''







    if length > 1:
        SCREAMING_SNAKE_CASE_   :	Dict													=   int(length / 2      )
        for i in range(lowerCamelCase_    ,    low + middle      ):
            comp_and_swap(lowerCamelCase_    ,    lowerCamelCase_    ,    i + middle    ,    lowerCamelCase_      )
        bitonic_merge(lowerCamelCase_    ,    lowerCamelCase_    ,    lowerCamelCase_    ,    lowerCamelCase_      )
        bitonic_merge(lowerCamelCase_    ,    low + middle    ,    lowerCamelCase_    ,    lowerCamelCase_      )



def 					_lowerCamelCase(			lowerCAmelCase__				:		Tuple    ,    lowerCAmelCase__				:		Dict    ,    lowerCAmelCase__				:		int    ,    lowerCAmelCase__				:		List[str]      ):





    '''simple docstring'''







    if length > 1:
        SCREAMING_SNAKE_CASE_   :	int													=   int(length / 2      )
        bitonic_sort(lowerCamelCase_    ,    lowerCamelCase_    ,    lowerCamelCase_    ,    1      )
        bitonic_sort(lowerCamelCase_    ,    low + middle    ,    lowerCamelCase_    ,    0      )
        bitonic_merge(lowerCamelCase_    ,    lowerCamelCase_    ,    lowerCamelCase_    ,    lowerCamelCase_      )


if __name__ == "__main__":
    A        =			input('Enter numbers separated by a comma:\n').strip()
    A        =			[int(item.strip()) for item in user_input.split(',')]

    bitonic_sort(unsorted, 0, len(unsorted), 1)
    print('\nSorted array in ascending order is: ', end='')
    print(*unsorted, sep=', ')

    bitonic_merge(unsorted, 0, len(unsorted), 0)
    print('Sorted array in descending order is: ', end='')
    print(*unsorted, sep=', ')







from timeit import timeit



def 					_lowerCamelCase(			lowerCAmelCase__				:		int      ):





				'''simple docstring'''







				if number < 0:
								raise ValueError('the value of input must not be negative'      )
				SCREAMING_SNAKE_CASE_   :	Tuple													=   0
				while number:
								number &= number - 1
								result += 1
				return result



def 					_lowerCamelCase(			lowerCAmelCase__				:		int      ):





				'''simple docstring'''







				if number < 0:
								raise ValueError('the value of input must not be negative'      )
				SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   0
				while number:
								if number % 2 == 1:
												result += 1
								number >>= 1
				return result



def 					_lowerCamelCase(			):





				'''simple docstring'''







				def do_benchmark(lowerCAmelCase__				:		int      ) -> None:
								SCREAMING_SNAKE_CASE_   :	int													=   'import __main__ as z'
								print(F'''Benchmark when {number = }:'''      )
								print(F'''{get_set_bits_count_using_modulo_operator(lowerCAmelCase__      ) = }'''      )
								SCREAMING_SNAKE_CASE_   :	int													=   timeit('z.get_set_bits_count_using_modulo_operator(25)'    ,    setup=lowerCAmelCase__      )
								print(F'''timeit() runs in {timing} seconds'''      )
								print(F'''{get_set_bits_count_using_brian_kernighans_algorithm(lowerCAmelCase__      ) = }'''      )
								SCREAMING_SNAKE_CASE_   :	Optional[Any]													=   timeit(
								    'z.get_set_bits_count_using_brian_kernighans_algorithm(25)'    ,    setup=lowerCAmelCase__    ,    )
								print(F'''timeit() runs in {timing} seconds'''      )

				for number in (25, 37, 58, 0):
								do_benchmark(lowerCAmelCase__      )
								print()


if __name__ == "__main__":
				import doctest

				doctest.testmod()
				benchmark()