// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xd0, %rsp
movb $0x0, %al
callq 0x5bf0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0xabfe(%rip), %eax      # 0xf4a0
jge 0x48c6
movslq -0x4(%rbp), %rax
leaq 0xa8d1(%rip), %rdi      # 0xf180
imulq $0x28, %rax, %rax
addq %rax, %rdi
callq 0x5fa0
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x4899
leaq 0x6ae4(%rip), %rdi      # 0xb3b1
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rsi
movq %rcx, %rdx
callq 0x6630
movq %rax, -0x10(%rbp)
movq 0x6789(%rip), %rax      # 0xb070
movq %rax, -0x30(%rbp)
movq 0x6786(%rip), %rax      # 0xb078
movq %rax, -0x28(%rbp)
movq 0x6783(%rip), %rax      # 0xb080
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x6, %edx
callq 0x4350
xorl %eax, %eax
movl %eax, %ecx
leaq 0x6a36(%rip), %rsi      # 0xb354
movq %rcx, %rdi
movq %rcx, %rdx
callq 0x6630
movq %rax, -0x38(%rbp)
movq 0x76ec(%rip), %rax      # 0xc020
movq %rax, -0x50(%rbp)
movq 0x76e9(%rip), %rax      # 0xc028
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x4, %edx
callq 0x4350
leaq 0x6a55(%rip), %rdi      # 0xb3b1
leaq 0x69f1(%rip), %rsi      # 0xb354
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rdx
callq 0x6630
movq %rax, -0x58(%rbp)
movl 0x76b7(%rip), %eax      # 0xc030
movl %eax, -0x5c(%rbp)
movq -0x58(%rbp), %rdi
leaq -0x5c(%rbp), %rsi
movl $0x1, %edx
callq 0x4350
xorl %eax, %eax
movl %eax, %ecx
leaq 0x69c5(%rip), %rdx      # 0xb35e
movq %rcx, %rdi
movq %rcx, %rsi
callq 0x6630
movq %rax, -0x68(%rbp)
leaq -0x90(%rbp), %rdi
leaq 0x66da(%rip), %rsi      # 0xb090
movl $0x24, %edx
callq 0x2180
movq -0x68(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movl $0x9, %edx
callq 0x4350
xorl %eax, %eax
movl %eax, %edx
leaq 0x6b5b(%rip), %rcx      # 0xb53b
movq %rdx, %rdi
movq %rdx, %rsi
callq 0x6630
movq %rax, -0x98(%rbp)
movq 0x66bb(%rip), %rax      # 0xb0b4
movq %rax, -0xa4(%rbp)
movl 0x66b6(%rip), %eax      # 0xb0bc
movl %eax, -0x9c(%rbp)
movq -0x98(%rbp), %rdi
leaq -0xa4(%rbp), %rsi
movl $0x3, %edx
callq 0x4350
leaq 0x691f(%rip), %rdi      # 0xb34a
xorl %eax, %eax
movl %eax, %esi
leaq 0x69b9(%rip), %rdx      # 0xb3ef
leaq 0x6a13(%rip), %rcx      # 0xb450
callq 0x6630
movq %rax, -0xb0(%rbp)
movq 0x6670(%rip), %rax      # 0xb0c0
movq %rax, -0xbc(%rbp)
movl 0x666b(%rip), %eax      # 0xb0c8
movl %eax, -0xb4(%rbp)
movq -0xb0(%rbp), %rdi
leaq -0xbc(%rbp), %rsi
movl $0x3, %edx
callq 0x4350
xorl %eax, %eax
movl %eax, %edi
leaq 0x68e9(%rip), %rsi      # 0xb36f
leaq 0x6962(%rip), %rdx      # 0xb3ef
leaq 0x68ca(%rip), %rcx      # 0xb35e
callq 0x6630
movq %rax, -0xc8(%rbp)
movq 0x6659(%rip), %rax      # 0xb100
movq %rax, -0xd0(%rbp)
movq -0xc8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
movl $0x2, %edx
callq 0x4350
movb $0x0, %al
callq 0x5ce0
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)