// File: PrarabdhJoshi[P]DatabaseImplementation/test.cc
// Function: main
int main () {
cout <<"here";
	setup (catalog_path, dbfile_dir, tpch_dir);

	void (*test) ();
	relation *rel_ptr[] = {n, r, c, p, ps, o, li};
	void (*test_ptr[]) () = {&test1, &test2, &test3};  

	int tindx = 0;
	while (tindx < 1 || tindx > 3) {
		cout << " select test: \n";
		cout << " \t 1. load file \n";
		cout << " \t 2. scan \n";
		cout << " \t 3. scan & filter \n \t ";
		cin >> tindx;
	}

	int findx = 0;
	while (findx < 1 || findx > 7) {
		cout << "\n select table: \n";
		cout << "\t 1. nation \n";
		cout << "\t 2. region \n";
		cout << "\t 3. customer \n";
		cout << "\t 4. part \n";
		cout << "\t 5. partsupp \n";
		cout << "\t 6. orders \n";
		cout << "\t 7. lineitem \n \t ";
		cin >> findx;
	}

	rel = rel_ptr [findx - 1];
	test = test_ptr [tindx - 1];

	test ();

	cleanup ();
}

// Assembly:
subq $0x78, %rsp
movl $0x0, 0x74(%rsp)
movq 0x50a5(%rip), %rdi      # 0xffb8
leaq 0x1c82(%rip), %rsi      # 0xcb9c
callq 0x2140
movq 0x52fa(%rip), %rdi      # 0x10220
movq 0x52e3(%rip), %rsi      # 0x10210
movq 0x52e4(%rip), %rdx      # 0x10218
callq 0xa1d0
movq 0x53a8(%rip), %rax      # 0x102e8
movq %rax, 0x30(%rsp)
movq 0x53ac(%rip), %rax      # 0x102f8
movq %rax, 0x38(%rsp)
movq 0x53b0(%rip), %rax      # 0x10308
movq %rax, 0x40(%rsp)
movq 0x5374(%rip), %rax      # 0x102d8
movq %rax, 0x48(%rsp)
movq 0x5370(%rip), %rax      # 0x102e0
movq %rax, 0x50(%rsp)
movq 0x5384(%rip), %rax      # 0x10300
movq %rax, 0x58(%rsp)
movq 0x5368(%rip), %rax      # 0x102f0
movq %rax, 0x60(%rsp)
movq 0x4dbc(%rip), %rax      # 0xfd50
movq %rax, 0x10(%rsp)
movq 0x4db8(%rip), %rax      # 0xfd58
movq %rax, 0x18(%rsp)
movq 0x4db4(%rip), %rax      # 0xfd60
movq %rax, 0x20(%rsp)
movl $0x0, 0xc(%rsp)
movb $0x1, %al
cmpl $0x1, 0xc(%rsp)
movb %al, 0x7(%rsp)
jl 0xafd2
cmpl $0x3, 0xc(%rsp)
setg %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0xafdc
jmp 0xb03e
movq 0x4fd5(%rip), %rdi      # 0xffb8
leaq 0x1c31(%rip), %rsi      # 0xcc1b
callq 0x2140
movq 0x4fc2(%rip), %rdi      # 0xffb8
leaq 0x1c2e(%rip), %rsi      # 0xcc2b
callq 0x2140
movq 0x4faf(%rip), %rdi      # 0xffb8
leaq 0x1c2d(%rip), %rsi      # 0xcc3d
callq 0x2140
movq 0x4f9c(%rip), %rdi      # 0xffb8
leaq 0x1c27(%rip), %rsi      # 0xcc4a
callq 0x2140
movq 0x4fa1(%rip), %rdi      # 0xffd0
leaq 0xc(%rsp), %rsi
callq 0x20f0
jmp 0xafb9
movl $0x0, 0x8(%rsp)
movb $0x1, %al
cmpl $0x1, 0x8(%rsp)
movb %al, 0x6(%rsp)
jl 0xb05f
cmpl $0x7, 0x8(%rsp)
setg %al
movb %al, 0x6(%rsp)
movb 0x6(%rsp), %al
testb $0x1, %al
jne 0xb06c
jmp 0xb11a
movq 0x4f45(%rip), %rdi      # 0xffb8
leaq 0x1be9(%rip), %rsi      # 0xcc63
callq 0x2140
movq 0x4f32(%rip), %rdi      # 0xffb8
leaq 0x1be8(%rip), %rsi      # 0xcc75
callq 0x2140
movq 0x4f1f(%rip), %rdi      # 0xffb8
leaq 0x1be3(%rip), %rsi      # 0xcc83
callq 0x2140
movq 0x4f0c(%rip), %rdi      # 0xffb8
leaq 0x1bde(%rip), %rsi      # 0xcc91
callq 0x2140
movq 0x4ef9(%rip), %rdi      # 0xffb8
leaq 0x1bdb(%rip), %rsi      # 0xcca1
callq 0x2140
movq 0x4ee6(%rip), %rdi      # 0xffb8
leaq 0x1bd4(%rip), %rsi      # 0xccad
callq 0x2140
movq 0x4ed3(%rip), %rdi      # 0xffb8
leaq 0x1bd1(%rip), %rsi      # 0xccbd
callq 0x2140
movq 0x4ec0(%rip), %rdi      # 0xffb8
leaq 0x1bcc(%rip), %rsi      # 0xcccb
callq 0x2140
movq 0x4ec5(%rip), %rdi      # 0xffd0
leaq 0x8(%rsp), %rsi
callq 0x20f0
jmp 0xb046
movl 0x8(%rsp), %eax
subl $0x1, %eax
cltq
movq 0x30(%rsp,%rax,8), %rax
movq %rax, 0x51e1(%rip)      # 0x10310
movl 0xc(%rsp), %eax
subl $0x1, %eax
cltq
movq 0x10(%rsp,%rax,8), %rax
movq %rax, 0x68(%rsp)
callq *0x68(%rsp)
callq 0xa910
movl 0x74(%rsp), %eax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)
nop