// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq -0x2f(%rip), %rdi       # 0x4480
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x5550
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x5990
cmpq $0x0, -0x8(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x1e01(%rip), %rsi      # 0x62e1
movl $0x25, %edx
leaq 0x1fa4(%rip), %rcx      # 0x6490
leaq 0x1e06(%rip), %r8       # 0x62f9
movb $0x0, %al
callq 0x2380
cmpl $0x0, %eax
jne 0x4504
callq 0x2e60
jmp 0x4506
jmp 0x4508
movq -0x8(%rbp), %rdi
callq 0x5650
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x1dbe(%rip), %rsi      # 0x62e1
movl $0x26, %edx
leaq 0x1f61(%rip), %rcx      # 0x6490
leaq 0x1dd2(%rip), %r8       # 0x6308
movb $0x0, %al
callq 0x2380
cmpl $0x0, %eax
jne 0x4547
callq 0x2e60
jmp 0x4549
movq -0x8(%rbp), %rdi
callq 0x59c0
xorl %edi, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x5a00
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
xorl %edi, %edi
callq 0x4450
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x5ba0
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x1, %edi
callq 0x4450
movq -0x28(%rbp), %rdi
movq %rax, %rsi
callq 0x5ba0
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x2, %edi
callq 0x4450
movq -0x20(%rbp), %rdi
movq %rax, %rsi
callq 0x5ba0
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x3, %edi
callq 0x4450
movq -0x18(%rbp), %rdi
movq %rax, %rsi
callq 0x5ba0
movq -0x10(%rbp), %rdx
leaq -0x161(%rip), %rdi      # 0x4480
movq 0x49d8(%rip), %rsi      # 0x8fc0
callq 0x5550
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x1cdc(%rip), %rsi      # 0x62e1
movl $0x32, %edx
leaq 0x1e7f(%rip), %rcx      # 0x6490
leaq 0x1ce1(%rip), %r8       # 0x62f9
movb $0x0, %al
callq 0x2380
cmpl $0x0, %eax
jne 0x4629
callq 0x2e60
jmp 0x462b
jmp 0x462d
movq -0x8(%rbp), %rdi
callq 0x5650
cmpl $0x4, %eax
sete %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x1c99(%rip), %rsi      # 0x62e1
movl $0x33, %edx
leaq 0x1e3c(%rip), %rcx      # 0x6490
leaq 0x1cc6(%rip), %r8       # 0x6321
movb $0x0, %al
callq 0x2380
cmpl $0x0, %eax
jne 0x466c
callq 0x2e60
jmp 0x466e
jmp 0x4670
movq -0x8(%rbp), %rdi
callq 0x5670
cmpl $0x3, (%rax)
sete %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x1c56(%rip), %rsi      # 0x62e1
movl $0x35, %edx
leaq 0x1df9(%rip), %rcx      # 0x6490
leaq 0x1c9c(%rip), %r8       # 0x633a
movb $0x0, %al
callq 0x2380
cmpl $0x0, %eax
jne 0x46af
callq 0x2e60
jmp 0x46b1
movq -0x8(%rbp), %rdi
callq 0x5790
movq -0x8(%rbp), %rdi
callq 0x5670
cmpl $0x2, (%rax)
sete %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x1c0c(%rip), %rsi      # 0x62e1
movl $0x37, %edx
leaq 0x1daf(%rip), %rcx      # 0x6490
leaq 0x1c71(%rip), %r8       # 0x6359
movb $0x0, %al
callq 0x2380
cmpl $0x0, %eax
jne 0x46f9
callq 0x2e60
jmp 0x46fb
movq -0x10(%rbp), %rdi
callq 0x5db0
movq -0x8(%rbp), %rdi
callq 0x59c0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)