// File: /workspace/github_c_makefile_star2_O1/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 0x151b(%rip), %rbx      # 0x406f
movq %rbx, %rdi
callq 0x1030
leaq 0x175c(%rip), %rdi      # 0x42bf
callq 0x1030
movq %rbx, %rdi
callq 0x1030
leaq -0x37e(%rip), %rdi      # 0x27f9
leaq -0x371(%rip), %rsi      # 0x280d
movq 0x4433(%rip), %rdx      # 0x6fb8
callq 0x1b58
testq %rax, %rax
je 0x2ccc
movq %rax, %r14
movl $0xd, %ebp
movq %rsp, %r15
leaq 0x173b(%rip), %r12      # 0x42e0
leaq 0x1757(%rip), %r13      # 0x4303
callq 0x10b0
movl %eax, %ecx
imulq $0x51eb851f, %rcx, %rcx # imm = 0x51EB851F
shrq $0x24, %rcx
imull $0x32, %ecx, %ecx
subl %ecx, %eax
movq %rax, (%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x1c3b
testl %eax, %eax
je 0x2be0
movq %r13, %rdi
callq 0x1030
jmp 0x2bed
movl (%rsp), %esi
movq %r12, %rdi
xorl %eax, %eax
callq 0x1050
decq %rbp
jne 0x2bac
movq %rsp, %r15
movq $0xa, (%r15)
leaq 0x1720(%rip), %rdi      # 0x4323
movl $0xa, %esi
xorl %eax, %eax
callq 0x1050
movq %r14, %rdi
movq %r15, %rsi
callq 0x1caf
leaq 0x1942(%rip), %rdi      # 0x4563
callq 0x1030
movl $0xb, %esi
movq %r14, %rdi
callq 0x1d75
movq %r14, %rdi
xorl %esi, %esi
callq 0x1e97
testq %rax, %rax
je 0x2c81
movq %rax, %r13
movl $0x1, %r15d
leaq 0x16f0(%rip), %r12      # 0x4342
movl (%r13), %edx
movq %r12, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x1050
movq %r13, %rdi
callq 0x10c0
movq %r14, %rdi
movq %r15, %rsi
callq 0x1e97
movq %rax, %r13
incq %r15
testq %rax, %rax
jne 0x2c52
leaq 0x18ff(%rip), %rdi      # 0x4587
callq 0x1030
movq %r14, %rdi
callq 0x1bda
callq 0x10b0
movl %eax, %ecx
imulq $0x51eb851f, %rcx, %rcx # imm = 0x51EB851F
shrq $0x24, %rcx
imull $0x32, %ecx, %ecx
subl %ecx, %eax
movq %rsp, %rsi
movq %rax, (%rsi)
movq %r14, %rdi
callq 0x1c3b
testl %eax, %eax
je 0x2cd5
leaq 0x163e(%rip), %rdi      # 0x4303
callq 0x1030
jmp 0x2ce6
leaq 0x15f8(%rip), %rbx      # 0x42cb
jmp 0x2d0e
movl (%rsp), %esi
leaq 0x168a(%rip), %rdi      # 0x4369
xorl %eax, %eax
callq 0x1050
leaq 0x18b3(%rip), %rdi      # 0x45a0
callq 0x1030
movq %r14, %rdi
callq 0x1c13
movq %rbx, %rdi
callq 0x1030
leaq 0x15b6(%rip), %rdi      # 0x42bf
callq 0x1030
movq %rbx, %rdi
callq 0x1030
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq