// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
leaq 0x1495(%rip), %rbx      # 0x406f
movq %rbx, %rdi
callq 0x1030
leaq 0x16d6(%rip), %rdi      # 0x42bf
callq 0x1030
movq %rbx, %rdi
callq 0x1030
leaq -0x380(%rip), %rdi      # 0x287d
leaq -0x373(%rip), %rsi      # 0x2891
movq 0x43ad(%rip), %rdx      # 0x6fb8
callq 0x1b80
testq %rax, %rax
je 0x2d5b
movq %rax, %rbx
movl $0xd, %r13d
leaq 0x8(%rsp), %r14
leaq 0x16b2(%rip), %r15      # 0x42e0
leaq 0x16ce(%rip), %r12      # 0x4303
callq 0x10b0
movl %eax, %ecx
imulq $0x51eb851f, %rcx, %rcx # imm = 0x51EB851F
shrq $0x24, %rcx
imull $0x32, %ecx, %ecx
subl %ecx, %eax
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1c8d
testl %eax, %eax
je 0x2c6a
movq %r12, %rdi
callq 0x1030
jmp 0x2c78
movl 0x8(%rsp), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x1050
decq %r13
jne 0x2c35
leaq 0x8(%rsp), %r14
movq $0xa, (%r14)
leaq 0x1693(%rip), %rdi      # 0x4323
movl $0xa, %esi
xorl %eax, %eax
callq 0x1050
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1d01
leaq 0x18b5(%rip), %rdi      # 0x4563
callq 0x1030
movl $0xb, %esi
movq %rbx, %rdi
callq 0x1dc7
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1ed7
testq %rax, %rax
je 0x2d0e
movq %rax, %r12
movl $0x1, %r14d
leaq 0x1663(%rip), %r15      # 0x4342
movl (%r12), %edx
movq %r15, %rdi
movl %r14d, %esi
xorl %eax, %eax
callq 0x1050
movq %r12, %rdi
callq 0x10c0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1ed7
movq %rax, %r12
incq %r14
testq %rax, %rax
jne 0x2cdf
leaq 0x1872(%rip), %rdi      # 0x4587
callq 0x1030
movq %rbx, %rdi
callq 0x1c2c
callq 0x10b0
movl %eax, %ecx
imulq $0x51eb851f, %rcx, %rcx # imm = 0x51EB851F
shrq $0x24, %rcx
imull $0x32, %ecx, %ecx
subl %ecx, %eax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %rbx, %rdi
callq 0x1c8d
testl %eax, %eax
je 0x2d74
leaq 0x15af(%rip), %rdi      # 0x4303
callq 0x1030
jmp 0x2d86
leaq 0x1569(%rip), %rdi      # 0x42cb
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x1030
movl 0x8(%rsp), %esi
leaq 0x15ea(%rip), %rdi      # 0x4369
xorl %eax, %eax
callq 0x1050
leaq 0x1813(%rip), %rdi      # 0x45a0
callq 0x1030
movq %rbx, %rdi
callq 0x1c65
leaq 0x12ce(%rip), %rbx      # 0x406f
movq %rbx, %rdi
callq 0x1030
leaq 0x150f(%rip), %rdi      # 0x42bf
callq 0x1030
movq %rbx, %rdi
callq 0x1030
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq