// File: /workspace/github_c_makefile_star2_O1/Enes1313[P]DataStructures/Test/main.c
// Function: testCircularBuffer
void testCircularBuffer()
{
	size_t len = 0;
	eaDSCircularBuffer circularBuffer;
	char data[] = {"{ \"Who\" : \"Enes\",{ \"Who\" : \"Enes\", \"Birth\" : 1994 }drgtfhyjg{ \"Who\" : \"Reis\", \"Birth\" : 8888 }"};

	puts("********************************************");
	puts("Circular Buffer");
	puts("********************************************");

	if (NULL == (circularBuffer = eaDSCircularBufferInit(sizeof(char), malloc, memcpy, memcmp, free)))
	{
		puts("circularBuffer olusmadi!");
		return;
	}

	while (EXIT_SUCCESS == eaDSCircularBufferAdd(circularBuffer, data, strlen(data)))
	{
		puts("circularBuffer'a veri eklendi!");
	}

	memset(data, 0, sizeof(data));

	if (EXIT_SUCCESS == eaDSCircularBufferGetWhereIsIt(circularBuffer, "{", 1, &len))
	{
		eaDSCircularBufferMoveHead(circularBuffer, len);

		if (EXIT_SUCCESS == eaDSCircularBufferGetWhereIsIt(circularBuffer, "}", 1, &len))
		{
			if (EXIT_SUCCESS == eaDSCircularBufferGet(circularBuffer, data, len + 1))
			{
				printf("circularBuffer'dan cekilen veri : %s\n", data);
			}
		}
		else
		{
			puts("Bo");
		}
	}

	if (EXIT_SUCCESS == eaDSCircularBufferAdd(circularBuffer, data, strlen(data)))
	{
		puts("circularBuffer'a veri eklendi!");
	}

	if (EXIT_SUCCESS == eaDSCircularBufferAdd(circularBuffer, data, strlen(data)))
	{
		puts("circularBuffer'a veri eklendi!");
	}

	if (EXIT_SUCCESS == eaDSCircularBufferAdd(circularBuffer, data, strlen(data)))
	{
		puts("circularBuffer'a veri eklendi!");
	}

	memset(data, 0, sizeof(data));

	if (EXIT_SUCCESS == eaDSCircularBufferGetWhereIsIt(circularBuffer, "{", 1, &len))
	{
		eaDSCircularBufferMoveHead(circularBuffer, len);

		if (EXIT_SUCCESS == eaDSCircularBufferGetWhereIsIt(circularBuffer, "}", 1, &len))
		{
			if (EXIT_SUCCESS == eaDSCircularBufferGet(circularBuffer, data, len + 1))
			{
				printf("circularBuffer'dan cekilen veri : %s\n", data);
			}
		}
		else
		{
			puts("Bo");
		}
	}

	if (EXIT_SUCCESS != eaDSCircularBufferAdd(circularBuffer, "dff", 3))
	{
		puts("circularBuffer'a veri eklenemedi!");
	}
	{
		memset(data, 0, sizeof(data));

		if (EXIT_SUCCESS == eaDSCircularBufferGet(circularBuffer, data, 1))
		{
			printf("circularBuffer'dan cekilen veri : %s\n", data);
			memset(data, 0, 1);
		}

		while (EXIT_SUCCESS == eaDSCircularBufferGetWhereIsIt(circularBuffer, "{", 1, &len))
		{
			eaDSCircularBufferMoveHead(circularBuffer, len);

			if (EXIT_SUCCESS == eaDSCircularBufferGetWhereIsIt(circularBuffer, "}", 1, &len))
			{
				if (EXIT_SUCCESS == eaDSCircularBufferGet(circularBuffer, data, len + 1))
				{
					printf("circularBuffer'dan cekilen veri : %s\n", data);
					memset(data, 0, sizeof(data));
				}
			}
			else
			{
				puts("Bo");
				break;
			}
		}
	}

	eaDSCircularBufferClear(circularBuffer);

	puts("********************************************");
	puts("Circular Buffer");
	puts("********************************************");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq $0x0, 0x8(%rsp)
leaq 0x1c1a(%rip), %rsi      # 0x4010
leaq 0x10(%rsp), %rax
movl $0xb, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movl $0x7d2038, 0x5b(%rax)   # imm = 0x7D2038
movl $0x38383838, 0x58(%rax) # imm = 0x38383838
leaq 0x1c54(%rip), %rbx      # 0x406f
movq %rbx, %rdi
callq 0x1030
leaq 0x1c72(%rip), %rdi      # 0x409c
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movq 0x4baa(%rip), %rsi      # 0x6fe8
movq 0x4b9b(%rip), %rdx      # 0x6fe0
movq 0x4b84(%rip), %rcx      # 0x6fd0
movq 0x4b65(%rip), %r8       # 0x6fb8
movl $0x1, %edi
callq 0x124c
testq %rax, %rax
je 0x252d
movq %rax, %r14
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x1040
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x1304
testl %eax, %eax
jne 0x24b6
leaq 0x1c36(%rip), %r15      # 0x40c5
leaq 0x10(%rsp), %r12
movq %r15, %rdi
callq 0x1030
movq %r12, %rdi
callq 0x1040
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x1304
testl %eax, %eax
je 0x2494
xorps %xmm0, %xmm0
movups %xmm0, 0x5f(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
leaq 0x1c06(%rip), %rsi      # 0x40e4
leaq 0x8(%rsp), %rcx
movl $0x1, %edx
movq %r14, %rdi
callq 0x14d5
testl %eax, %eax
jne 0x2565
leaq 0x8(%rsp), %r15
movq (%r15), %rsi
movq %r14, %rdi
callq 0x1594
leaq 0x1bdb(%rip), %rsi      # 0x40e6
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rcx
callq 0x14d5
testl %eax, %eax
je 0x2539
leaq 0x1be8(%rip), %rdi      # 0x410e
callq 0x1030
jmp 0x2565
leaq 0x1b78(%rip), %rbx      # 0x40ac
jmp 0x27e2
movq 0x8(%rsp), %rdx
incq %rdx
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x13f1
testl %eax, %eax
jne 0x2565
leaq 0x1b8f(%rip), %rdi      # 0x40e8
leaq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x1050
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x1040
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x1304
testl %eax, %eax
jne 0x2590
leaq 0x1b3a(%rip), %rdi      # 0x40c5
callq 0x1030
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x1040
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x1304
testl %eax, %eax
jne 0x25bb
leaq 0x1b0f(%rip), %rdi      # 0x40c5
callq 0x1030
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x1040
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x1304
testl %eax, %eax
jne 0x25e6
leaq 0x1ae4(%rip), %rdi      # 0x40c5
callq 0x1030
xorps %xmm0, %xmm0
movups %xmm0, 0x5f(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
leaq 0x1ad6(%rip), %rsi      # 0x40e4
leaq 0x8(%rsp), %rcx
movl $0x1, %edx
movq %r14, %rdi
callq 0x14d5
testl %eax, %eax
jne 0x2689
leaq 0x8(%rsp), %r15
movq (%r15), %rsi
movq %r14, %rdi
callq 0x1594
leaq 0x1aab(%rip), %rsi      # 0x40e6
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rcx
callq 0x14d5
testl %eax, %eax
je 0x265d
leaq 0x1ab8(%rip), %rdi      # 0x410e
callq 0x1030
jmp 0x2689
movq 0x8(%rsp), %rdx
incq %rdx
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x13f1
testl %eax, %eax
jne 0x2689
leaq 0x1a6b(%rip), %rdi      # 0x40e8
leaq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x1050
leaq 0x1a81(%rip), %rsi      # 0x4111
movl $0x3, %edx
movq %r14, %rdi
callq 0x1304
testl %eax, %eax
je 0x26ad
leaq 0x1a6d(%rip), %rdi      # 0x4115
callq 0x1030
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
movups %xmm0, 0x4f(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movl $0x1, %edx
movq %r14, %rdi
callq 0x13f1
testl %eax, %eax
jne 0x26f7
leaq 0x1a04(%rip), %rdi      # 0x40e8
leaq 0x10(%rsp), %r15
movq %r15, %rsi
xorl %eax, %eax
callq 0x1050
movb $0x0, (%r15)
leaq 0x19e6(%rip), %rsi      # 0x40e4
leaq 0x8(%rsp), %rcx
movl $0x1, %edx
movq %r14, %rdi
callq 0x14d5
testl %eax, %eax
jne 0x27c6
leaq 0x19c7(%rip), %r15      # 0x40e6
leaq 0x8(%rsp), %r12
leaq 0x10(%rsp), %r13
leaq 0x19b4(%rip), %rbp      # 0x40e4
movq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x1594
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rcx
callq 0x14d5
testl %eax, %eax
jne 0x27ba
movq 0x8(%rsp), %rdx
incq %rdx
movq %r14, %rdi
movq %r13, %rsi
callq 0x13f1
testl %eax, %eax
jne 0x279d
leaq 0x1976(%rip), %rdi      # 0x40e8
movq %r13, %rsi
xorl %eax, %eax
callq 0x1050
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x50(%rsp)
movups %xmm0, 0x5f(%rsp)
movl $0x1, %edx
movq %r14, %rdi
movq %rbp, %rsi
movq %r12, %rcx
callq 0x14d5
testl %eax, %eax
je 0x2730
jmp 0x27c6
leaq 0x194d(%rip), %rdi      # 0x410e
callq 0x1030
movq %r14, %rdi
callq 0x12f1
movq %rbx, %rdi
callq 0x1030
leaq 0x18bf(%rip), %rdi      # 0x409c
callq 0x1030
movq %rbx, %rdi
callq 0x1030
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq