// File: /workspace/github_c_makefile_star2_O3/giannisdravilas[P]Disease-Monitor/tests/DiseaseMonitor_test.c
// Function: test_get_records
void test_get_records(void) {
	dm_init();

	// insert records
	for(int i = 0; i < record_no; i++)
		dm_insert_record(&records[i]);	

	// try various search criteria
	List list1 = dm_get_records("Pale Mare", NULL, NULL, NULL);
	int ids1[] = {5, 6, 10, 11, 16, 17};
	check_record_list(list1, ids1, sizeof(ids1)/sizeof(int));

	List list2 = dm_get_records(NULL, "Targaryen", NULL, NULL);
	int ids2[] = {1, 5, 7, 13};
	check_record_list(list2, ids2, sizeof(ids2)/sizeof(int));

	List list3 = dm_get_records("Pale Mare", "Targaryen", NULL, NULL);
	int ids3[] = {5};
	check_record_list(list3, ids3, sizeof(ids3)/sizeof(int));

	List list4 = dm_get_records(NULL, NULL, "0301-01-01", NULL);
	int ids4[] = {1, 2, 3, 6, 9, 10, 11, 14, 18};
	check_record_list(list4, ids4, sizeof(ids4)/sizeof(int));

	List list5 = dm_get_records(NULL, NULL, NULL, "0297-01-01");
	int ids5[] = {5, 7, 13};
	check_record_list(list5, ids5, sizeof(ids5)/sizeof(int));

	List list6 = dm_get_records("Grayscale", NULL, "0299-01-01", "0300-01-01");
	int ids6[] = {8, 15, 20};
	check_record_list(list6, ids6, sizeof(ids6)/sizeof(int));

	List list7 = dm_get_records(NULL, "Lannister", "0299-01-01", "0301-01-01");
	int ids7[] = {8, 9};
	check_record_list(list7, ids7, sizeof(ids7)/sizeof(int));

	dm_destroy();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
xorl %eax, %eax
callq 0x4b3a
cmpl $0x0, 0xa42d(%rip)      # 0xe4c0
jle 0x40ba
leaq 0xa104(%rip), %rbx      # 0xe1a0
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x4e36
incq %r14
movslq 0xa40f(%rip), %rax      # 0xe4c0
addq $0x28, %rbx
cmpq %rax, %r14
jl 0x409f
leaq 0x5337(%rip), %rbx      # 0x93f8
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x52cd
leaq 0x4f9a(%rip), %rsi      # 0x9070
movq %rax, %rdi
movl $0x6, %edx
callq 0x3caf
leaq 0x52b1(%rip), %r14      # 0x939b
xorl %edi, %edi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x52cd
leaq 0x5061(%rip), %rsi      # 0x9160
movq %rax, %rdi
movl $0x4, %edx
callq 0x3caf
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x52cd
leaq 0xc(%rsp), %rsi
movl $0x5, (%rsi)
movq %rax, %rdi
movl $0x1, %edx
callq 0x3caf
leaq 0x526b(%rip), %rbx      # 0x93a5
xorl %edi, %edi
xorl %esi, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x52cd
leaq 0x4f41(%rip), %rsi      # 0x9090
movq %rax, %rdi
movl $0x9, %edx
callq 0x3caf
leaq 0x541f(%rip), %rcx      # 0x9582
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x52cd
leaq 0x4f3f(%rip), %rsi      # 0x90b4
movq %rax, %rdi
movl $0x3, %edx
callq 0x3caf
leaq 0x5208(%rip), %rdi      # 0x9391
leaq 0x52a6(%rip), %r14      # 0x9436
leaq 0x5300(%rip), %rcx      # 0x9497
xorl %esi, %esi
movq %r14, %rdx
callq 0x52cd
leaq 0x4f18(%rip), %rsi      # 0x90c0
movq %rax, %rdi
movl $0x3, %edx
callq 0x3caf
leaq 0x51fa(%rip), %rsi      # 0x93b6
xorl %edi, %edi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x52cd
movabsq $0x900000008, %rcx      # imm = 0x900000008
leaq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
movl $0x2, %edx
callq 0x3caf
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x4bfd