// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, 0x8(%rsp)
leaq 0xca9(%rip), %rsi       # 0x3010
pushq $0x5f
popq %rcx
leaq 0x10(%rsp), %rdi
rep  movsb (%rsi), %es:(%rdi)
leaq 0xcf7(%rip), %rbx       # 0x306f
movq %rbx, %rdi
callq 0x1030
leaq 0xd15(%rip), %rdi       # 0x309c
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movq 0x3c4d(%rip), %rsi      # 0x5fe8
movq 0x3c3e(%rip), %rdx      # 0x5fe0
movq 0x3c27(%rip), %rcx      # 0x5fd0
movq 0x3c08(%rip), %r8       # 0x5fb8
pushq $0x1
popq %rdi
callq 0x11cc
testq %rax, %rax
je 0x2467
movq %rax, %rbx
leaq 0x10(%rsp), %r14
leaq 0xcf5(%rip), %r15       # 0x30c5
movq %r14, %rdi
callq 0x1040
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1280
testl %eax, %eax
jne 0x23f4
movq %r15, %rdi
callq 0x1030
jmp 0x23d0
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 0xcc8(%rip), %rsi       # 0x30e4
pushq $0x1
popq %rdx
leaq 0x8(%rsp), %rcx
movq %rbx, %rdi
callq 0x1445
testl %eax, %eax
jne 0x24ad
leaq 0x8(%rsp), %r14
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x14ff
leaq 0xc9f(%rip), %rsi       # 0x30e6
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x1445
testl %eax, %eax
je 0x2481
leaq 0xcae(%rip), %rdi       # 0x310e
callq 0x1030
jmp 0x24ad
leaq 0xc3e(%rip), %rdi       # 0x30ac
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 0x1367
testl %eax, %eax
jne 0x24ad
leaq 0xc47(%rip), %rdi       # 0x30e8
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 0x1280
testl %eax, %eax
jne 0x24d8
leaq 0xbf2(%rip), %rdi       # 0x30c5
callq 0x1030
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x1040
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1280
testl %eax, %eax
jne 0x2503
leaq 0xbc7(%rip), %rdi       # 0x30c5
callq 0x1030
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x1040
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1280
testl %eax, %eax
jne 0x252e
leaq 0xb9c(%rip), %rdi       # 0x30c5
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 0xb8e(%rip), %rsi       # 0x30e4
pushq $0x1
popq %rdx
leaq 0x8(%rsp), %rcx
movq %rbx, %rdi
callq 0x1445
testl %eax, %eax
jne 0x25cd
leaq 0x8(%rsp), %r14
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x14ff
leaq 0xb65(%rip), %rsi       # 0x30e6
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x1445
testl %eax, %eax
je 0x25a1
leaq 0xb74(%rip), %rdi       # 0x310e
callq 0x1030
jmp 0x25cd
movq 0x8(%rsp), %rdx
incq %rdx
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x1367
testl %eax, %eax
jne 0x25cd
leaq 0xb27(%rip), %rdi       # 0x30e8
leaq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x1050
leaq 0xb3d(%rip), %rsi       # 0x3111
pushq $0x3
popq %rdx
movq %rbx, %rdi
callq 0x1280
testl %eax, %eax
je 0x25ef
leaq 0xb2b(%rip), %rdi       # 0x3115
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)
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x1367
testl %eax, %eax
jne 0x2637
leaq 0xac4(%rip), %rdi       # 0x30e8
leaq 0x10(%rsp), %r14
movq %r14, %rsi
xorl %eax, %eax
callq 0x1050
movb $0x0, (%r14)
leaq 0xaa6(%rip), %r14       # 0x30e4
pushq $0x1
popq %r15
leaq 0x8(%rsp), %r12
leaq 0xa98(%rip), %r13       # 0x30e6
leaq 0x10(%rsp), %rbp
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x1445
testl %eax, %eax
jne 0x26e4
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x14ff
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x1445
testl %eax, %eax
jne 0x26d8
movq 0x8(%rsp), %rdx
incq %rdx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x1367
testl %eax, %eax
jne 0x2653
leaq 0xa40(%rip), %rdi       # 0x30e8
movq %rbp, %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)
jmp 0x2653
leaq 0xa2f(%rip), %rdi       # 0x310e
callq 0x1030
movq %rbx, %rdi
callq 0x126d
leaq 0x97c(%rip), %rbx       # 0x306f
movq %rbx, %rdi
callq 0x1030
leaq 0x99a(%rip), %rdi       # 0x309c
callq 0x1030
movq %rbx, %rdi
callq 0x1030
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq