#include <stdint.h>
#include <stdlib.h>

#define ARRAY_SIZE 0x5000L

void bubbleSort(int numbers[], int array_size)
{
	int i, j, temp;

	for (i = (array_size - 1); i >= 0; i--)
	{
		for (j = 1; j <= i; j++)
		{
			if (numbers[j-1] > numbers[j])
			{
				temp = numbers[j-1];
				numbers[j-1] = numbers[j];
				numbers[j] = temp;
			}
		}
	}
}

int main(void)
{
	uint32_t *lArray = NULL;
	uint32_t lCnt = 0;

	lArray = (uint32_t*)malloc(sizeof(uint32_t) * ARRAY_SIZE);


	for(lCnt = 0; lCnt < ARRAY_SIZE; lCnt++)
	{
		lArray[lCnt] = rand();
	}

	bubbleSort(lArray, ARRAY_SIZE);

	free(lArray);

	return 0;
}
