// File: /workspace/github_c_makefile_star2_O3/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 0x1baa(%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 0x1be4(%rip), %rbx      # 0x406f
movq %rbx, %rdi
callq 0x1030
leaq 0x1c02(%rip), %rdi      # 0x409c
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movq 0x4b3a(%rip), %rsi      # 0x6fe8
movq 0x4b2b(%rip), %rdx      # 0x6fe0
movq 0x4b14(%rip), %rcx      # 0x6fd0
movq 0x4af5(%rip), %r8       # 0x6fb8
movl $0x1, %edi
callq 0x124c
testq %rax, %rax
je 0x259d
movq %rax, %rbx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x1040
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1304
testl %eax, %eax
jne 0x2526
leaq 0x1bc6(%rip), %r14      # 0x40c5
leaq 0x10(%rsp), %r15
movq %r14, %rdi
callq 0x1030
movq %r15, %rdi
callq 0x1040
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x1304
testl %eax, %eax
je 0x2504
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 0x1b96(%rip), %rsi      # 0x40e4
leaq 0x8(%rsp), %rcx
movl $0x1, %edx
movq %rbx, %rdi
callq 0x14cd
testl %eax, %eax
jne 0x25e3
leaq 0x8(%rsp), %r14
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x1597
leaq 0x1b6b(%rip), %rsi      # 0x40e6
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x14cd
testl %eax, %eax
je 0x25b7
leaq 0x1b78(%rip), %rdi      # 0x410e
callq 0x1030
jmp 0x25e3
leaq 0x1b08(%rip), %rdi      # 0x40ac
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
movq 0x8(%rsp), %rdx
incq %rdx
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x13ed
testl %eax, %eax
jne 0x25e3
leaq 0x1b11(%rip), %rdi      # 0x40e8
leaq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x1050
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x1040
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1304
testl %eax, %eax
jne 0x260e
leaq 0x1abc(%rip), %rdi      # 0x40c5
callq 0x1030
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x1040
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1304
testl %eax, %eax
jne 0x2639
leaq 0x1a91(%rip), %rdi      # 0x40c5
callq 0x1030
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x1040
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1304
testl %eax, %eax
jne 0x2664
leaq 0x1a66(%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 0x1a58(%rip), %rsi      # 0x40e4
leaq 0x8(%rsp), %rcx
movl $0x1, %edx
movq %rbx, %rdi
callq 0x14cd
testl %eax, %eax
jne 0x2707
leaq 0x8(%rsp), %r14
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x1597
leaq 0x1a2d(%rip), %rsi      # 0x40e6
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x14cd
testl %eax, %eax
je 0x26db
leaq 0x1a3a(%rip), %rdi      # 0x410e
callq 0x1030
jmp 0x2707
movq 0x8(%rsp), %rdx
incq %rdx
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x13ed
testl %eax, %eax
jne 0x2707
leaq 0x19ed(%rip), %rdi      # 0x40e8
leaq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x1050
leaq 0x1a03(%rip), %rsi      # 0x4111
movl $0x3, %edx
movq %rbx, %rdi
callq 0x1304
testl %eax, %eax
je 0x272b
leaq 0x19ef(%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 %rbx, %rdi
callq 0x13ed
testl %eax, %eax
jne 0x2775
leaq 0x1986(%rip), %rdi      # 0x40e8
leaq 0x10(%rsp), %r14
movq %r14, %rsi
xorl %eax, %eax
callq 0x1050
movb $0x0, (%r14)
leaq 0x1968(%rip), %rsi      # 0x40e4
leaq 0x8(%rsp), %rcx
movl $0x1, %edx
movq %rbx, %rdi
callq 0x14cd
testl %eax, %eax
jne 0x2843
leaq 0x1949(%rip), %r14      # 0x40e6
leaq 0x8(%rsp), %r15
leaq 0x10(%rsp), %r12
leaq 0x193a(%rip), %r13      # 0x40e8
leaq 0x192f(%rip), %rbp      # 0x40e4
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x1597
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rcx
callq 0x14cd
testl %eax, %eax
jne 0x2837
movq 0x8(%rsp), %rdx
incq %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x13ed
testl %eax, %eax
jne 0x281e
movq %r13, %rdi
movq %r12, %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 %rbx, %rdi
movq %rbp, %rsi
movq %r15, %rcx
callq 0x14cd
testl %eax, %eax
je 0x27b5
jmp 0x2843
leaq 0x18d0(%rip), %rdi      # 0x410e
callq 0x1030
movq %rbx, %rdi
callq 0x12f1
leaq 0x181d(%rip), %rbx      # 0x406f
movq %rbx, %rdi
callq 0x1030
leaq 0x183b(%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