// File: /workspace/github_c_makefile_star2_O2/chatziko-k08[P]lecture-code/tests/ADTPriorityQueue_test.c
// Function: test_create
void test_create(void) {
	PriorityQueue pqueue = pqueue_create(compare_ints, NULL, NULL);
	pqueue_set_destroy_value(pqueue, NULL);

	TEST_ASSERT(pqueue != NULL);
	TEST_ASSERT(pqueue_size(pqueue) == 0);

	pqueue_destroy(pqueue);

	// create με αρχικά στοιχεία
	Vector values = vector_create(0, NULL);			// χωρίς destroy function, το destroy θα το κάνει η ουρά!
	vector_insert_last(values, create_int(0));
	vector_insert_last(values, create_int(1));
	vector_insert_last(values, create_int(2));
	vector_insert_last(values, create_int(3));

	pqueue = pqueue_create(compare_ints, free, values);
	TEST_ASSERT(pqueue != NULL);
	TEST_ASSERT(pqueue_size(pqueue) == 4);

	TEST_ASSERT(*(int*)pqueue_max(pqueue) == 3);
	pqueue_remove_max(pqueue);
	TEST_ASSERT(*(int*)pqueue_max(pqueue) == 2);

	vector_destroy(values);
	pqueue_destroy(pqueue);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq -0x10(%rip), %rdi       # 0x3af2
xorl %esi, %esi
xorl %edx, %edx
callq 0x447c
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
callq 0x46ee
xorl %edi, %edi
testq %rbx, %rbx
setne %dil
leaq 0x17f0(%rip), %rsi      # 0x5318
leaq 0x1993(%rip), %rcx      # 0x54c2
leaq 0x17fa(%rip), %r8       # 0x5330
pushq $0x25
popq %rdx
xorl %eax, %eax
callq 0x23ac
testl %eax, %eax
je 0x3ce6
movq %rbx, %rdi
callq 0x4512
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0x17b9(%rip), %rsi      # 0x5318
leaq 0x195c(%rip), %rcx      # 0x54c2
leaq 0x17d2(%rip), %r8       # 0x533f
pushq $0x26
popq %rdx
xorl %eax, %eax
callq 0x23ac
testl %eax, %eax
je 0x3ce6
movq %rbx, %rdi
callq 0x46f7
xorl %edi, %edi
xorl %esi, %esi
callq 0x4718
movq %rax, %rbx
xorl %edi, %edi
callq 0x3ae3
movq %rbx, %rdi
movq %rax, %rsi
callq 0x47df
pushq $0x1
popq %rdi
callq 0x3ae3
movq %rbx, %rdi
movq %rax, %rsi
callq 0x47df
pushq $0x2
popq %rdi
callq 0x3ae3
movq %rbx, %rdi
movq %rax, %rsi
callq 0x47df
pushq $0x3
popq %rdi
callq 0x3ae3
movq %rbx, %rdi
movq %rax, %rsi
callq 0x47df
leaq -0xf3(%rip), %rdi       # 0x3af2
movq 0x53d4(%rip), %rsi      # 0x8fc0
movq %rbx, %rdx
callq 0x447c
movq %rax, %r14
xorl %edi, %edi
testq %rax, %rax
setne %dil
leaq 0x1711(%rip), %rsi      # 0x5318
leaq 0x18b4(%rip), %rcx      # 0x54c2
leaq 0x171b(%rip), %r8       # 0x5330
pushq $0x32
popq %rdx
xorl %eax, %eax
callq 0x23ac
testl %eax, %eax
je 0x3ce6
movq %r14, %rdi
callq 0x4512
xorl %edi, %edi
cmpl $0x4, %eax
sete %dil
leaq 0x16d9(%rip), %rsi      # 0x5318
leaq 0x187c(%rip), %rcx      # 0x54c2
leaq 0x170b(%rip), %r8       # 0x5358
pushq $0x33
popq %rdx
xorl %eax, %eax
callq 0x23ac
testl %eax, %eax
je 0x3ce6
movq %r14, %rdi
callq 0x451a
xorl %edi, %edi
cmpl $0x3, (%rax)
sete %dil
leaq 0x16a1(%rip), %rsi      # 0x5318
leaq 0x1844(%rip), %rcx      # 0x54c2
leaq 0x16ec(%rip), %r8       # 0x5371
pushq $0x35
popq %rdx
xorl %eax, %eax
callq 0x23ac
testl %eax, %eax
je 0x3ce6
movq %r14, %rdi
callq 0x45a4
movq %r14, %rdi
callq 0x451a
xorl %edi, %edi
cmpl $0x2, (%rax)
sete %dil
leaq 0x1665(%rip), %rsi      # 0x5318
leaq 0x1808(%rip), %rcx      # 0x54c2
leaq 0x16cf(%rip), %r8       # 0x5390
pushq $0x37
popq %rdx
xorl %eax, %eax
callq 0x23ac
testl %eax, %eax
je 0x3ce6
movq %rbx, %rdi
callq 0x48ee
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x46f7
callq 0x2bd0