// File: /workspace/github_c_makefile_star2_O2/Enes1313[P]DataStructures/Test/main.c
// Function: testLinkedList
void testLinkedList()
{
	size_t i, x;
	eaDSLinkedList linkedList;

	puts("********************************************");
	puts("Linked List");
	puts("********************************************");

	if (NULL == (linkedList = eaDSLinkedListInit(intCreateAndCopy, intCompare, free)))
	{
		puts("linkedList olusmadi!");
		return;
	}

	for(i = 0; i < 13; i++)
	{
		x = (unsigned int) rand() % 50;

		if(EXIT_SUCCESS == eaDSLinkedListAdd(linkedList, &x))
		{
			printf("LinkedList'e eleman eklendi : %d \n", (int)x);
		}
		else
		{
			puts("LinkedList'e eleman eklenemedi!");
		}
	}

	x = 10;

	printf("LinkedList'den siliniyor : %d\n", (int)x);
	eaDSLinkedListRemove(linkedList, &x);

	printf("LinkedList'den 12. eleman atiliyor!\n");
	eaDSLinkedListRemoveAt(linkedList, 11);

	for(i = 0; ; i++)
	{
		void * data = eaDSLinkedListGetFrom(linkedList, i);

		if (NULL != data)
		{
			printf("LinkedList'den %d. eleman alindi : %d\n", (int)i + 1, *(int *)data);
			free(data);
		}
		else
		{
			break;
		}
	}
	/*
	printf("LinkedList siralaniyor...\n");
	eaDSLinkedListSort(linkedList);

	for(i = 0; EXIT_SUCCESS == eaDSLinkedListGetFrom(linkedList, &x, i); i++)
	{
		printf("LinkedList'den %d. eleman alindi : %d\n", (int)i + 1, (int)x);
	}
	*/

	printf("LinkedList resetleniyor.\n");
	eaDSLinkedListReset(linkedList);

	x = (unsigned int) rand() % 50;

	if(EXIT_SUCCESS == eaDSLinkedListAdd(linkedList, &x))
	{
		printf("LinkedList'e eleman eklendi : %d\n", (int)x);
	}
	else
	{
		puts("LinkedList'e eleman eklenemedi!");
	}

	printf("LinkedList siliniyor.\n");
	eaDSLinkedListClear(linkedList);

	puts("********************************************");
	puts("Linked List");
	puts("********************************************");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x63a(%rip), %rbx       # 0x306f
movq %rbx, %rdi
callq 0x1030
leaq 0x87b(%rip), %rdi       # 0x32bf
callq 0x1030
movq %rbx, %rdi
callq 0x1030
leaq -0x33a(%rip), %rdi      # 0x271e
leaq -0x32f(%rip), %rsi      # 0x2730
movq 0x3552(%rip), %rdx      # 0x5fb8
callq 0x1ac8
testq %rax, %rax
je 0x2b7d
movq %rax, %rbx
pushq $0xd
popq %r13
pushq $0x32
popq %rbp
movq %rsp, %r14
leaq 0x858(%rip), %r15       # 0x32e0
leaq 0x874(%rip), %r12       # 0x3303
subq $0x1, %r13
jb 0x2aca
callq 0x10b0
xorl %edx, %edx
divl %ebp
movq %rdx, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1bcd
testl %eax, %eax
je 0x2abb
movq %r12, %rdi
callq 0x1030
jmp 0x2a8f
movl (%rsp), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x1050
jmp 0x2a8f
movq %rsp, %r14
movq $0xa, (%r14)
leaq 0x848(%rip), %rdi       # 0x3323
pushq $0xa
popq %rsi
xorl %eax, %eax
callq 0x1050
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1c3a
leaq 0xa6c(%rip), %rdi       # 0x3563
callq 0x1030
pushq $0xb
popq %rsi
movq %rbx, %rdi
callq 0x1cfd
leaq 0x834(%rip), %r14       # 0x3342
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1e10
testq %rax, %rax
je 0x2b40
movq %rax, %r12
incq %r15
movl (%rax), %edx
movq %r14, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x1050
movq %r12, %rdi
callq 0x10c0
jmp 0x2b11
leaq 0xa40(%rip), %rdi       # 0x3587
callq 0x1030
movq %rbx, %rdi
callq 0x1b72
callq 0x10b0
xorl %edx, %edx
divl %ebp
movq %rsp, %rsi
movq %rdx, (%rsi)
movq %rbx, %rdi
callq 0x1bcd
testl %eax, %eax
je 0x2b97
leaq 0x78d(%rip), %rdi       # 0x3303
callq 0x1030
jmp 0x2ba8
leaq 0x747(%rip), %rdi       # 0x32cb
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
movl (%rsp), %esi
leaq 0x7c8(%rip), %rdi       # 0x3369
xorl %eax, %eax
callq 0x1050
leaq 0x9f1(%rip), %rdi       # 0x35a0
callq 0x1030
movq %rbx, %rdi
callq 0x1ba5
leaq 0x4ac(%rip), %rbx       # 0x306f
movq %rbx, %rdi
callq 0x1030
leaq 0x6ed(%rip), %rdi       # 0x32bf
callq 0x1030
movq %rbx, %rdi
callq 0x1030
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq