// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x48a0
leaq 0xa329(%rip), %rbx      # 0xe180
movslq 0xa642(%rip), %rax      # 0xe4a0
cmpq %rax, %r14
jge 0x3e74
movq %rbx, %rdi
callq 0x4b6f
incq %r14
addq $0x28, %rbx
jmp 0x3e57
leaq 0x557d(%rip), %rbx      # 0x93f8
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x4ff0
leaq 0x51e0(%rip), %rsi      # 0x9070
pushq $0x6
popq %rdx
movq %rax, %rdi
callq 0x3a78
leaq 0x54f9(%rip), %r14      # 0x939b
xorl %edi, %edi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x4ff0
leaq 0x52a9(%rip), %rsi      # 0x9160
pushq $0x4
popq %rdx
movq %rax, %rdi
callq 0x3a78
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x4ff0
leaq 0x4(%rsp), %rsi
movl $0x5, (%rsi)
pushq $0x1
popq %rdx
movq %rax, %rdi
callq 0x3a78
leaq 0x54b7(%rip), %rbx      # 0x93a5
xorl %edi, %edi
xorl %esi, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x4ff0
leaq 0x518d(%rip), %rsi      # 0x9090
pushq $0x9
popq %rdx
movq %rax, %rdi
callq 0x3a78
leaq 0x566d(%rip), %rcx      # 0x9582
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4ff0
leaq 0x518d(%rip), %rsi      # 0x90b4
pushq $0x3
popq %rbp
movq %rax, %rdi
movl %ebp, %edx
callq 0x3a78
leaq 0x5456(%rip), %rdi      # 0x9391
leaq 0x54f4(%rip), %r14      # 0x9436
leaq 0x554e(%rip), %rcx      # 0x9497
xorl %esi, %esi
movq %r14, %rdx
callq 0x4ff0
leaq 0x5166(%rip), %rsi      # 0x90c0
movq %rax, %rdi
movl %ebp, %edx
callq 0x3a78
leaq 0x544b(%rip), %rsi      # 0x93b6
xorl %edi, %edi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x4ff0
movabsq $0x900000008, %rcx      # imm = 0x900000008
leaq 0x8(%rsp), %rsi
movq %rcx, (%rsi)
pushq $0x2
popq %rdx
movq %rax, %rdi
callq 0x3a78
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x4963