// File: /workspace/github_c_makefile_star2_O1/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 0x4c6e
cmpl $0x0, 0xa2fe(%rip)      # 0xe4c0
jle 0x41e9
leaq 0x9fd5(%rip), %rbx      # 0xe1a0
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x4f6a
incq %r14
movslq 0xa2e0(%rip), %rax      # 0xe4c0
addq $0x28, %rbx
cmpq %rax, %r14
jl 0x41ce
leaq 0x5208(%rip), %rbx      # 0x93f8
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x541d
leaq 0x4e6b(%rip), %rsi      # 0x9070
movq %rax, %rdi
movl $0x6, %edx
callq 0x3dd6
leaq 0x5182(%rip), %r14      # 0x939b
xorl %edi, %edi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x541d
leaq 0x4f32(%rip), %rsi      # 0x9160
movq %rax, %rdi
movl $0x4, %edx
callq 0x3dd6
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x541d
leaq 0xc(%rsp), %rsi
movl $0x5, (%rsi)
movq %rax, %rdi
movl $0x1, %edx
callq 0x3dd6
leaq 0x513c(%rip), %rbx      # 0x93a5
xorl %edi, %edi
xorl %esi, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x541d
leaq 0x4e12(%rip), %rsi      # 0x9090
movq %rax, %rdi
movl $0x9, %edx
callq 0x3dd6
leaq 0x52f0(%rip), %rcx      # 0x9582
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x541d
leaq 0x4e10(%rip), %rsi      # 0x90b4
movq %rax, %rdi
movl $0x3, %edx
callq 0x3dd6
leaq 0x50d9(%rip), %rdi      # 0x9391
leaq 0x5177(%rip), %r14      # 0x9436
leaq 0x51d1(%rip), %rcx      # 0x9497
xorl %esi, %esi
movq %r14, %rdx
callq 0x541d
leaq 0x4de9(%rip), %rsi      # 0x90c0
movq %rax, %rdi
movl $0x3, %edx
callq 0x3dd6
leaq 0x50cb(%rip), %rsi      # 0x93b6
xorl %edi, %edi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x541d
movabsq $0x900000008, %rcx      # imm = 0x900000008
leaq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
movl $0x2, %edx
callq 0x3dd6
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x4d31