// File: PrarabdhJoshi[P]DatabaseImplementation/./TwoWayList.cc
// Function: TwoWayList<Record>::TwoWayList()
TwoWayList <Type> :: TwoWayList ()
{

	// allocate space for the header
	list = new (std::nothrow) Header;
	if (list == NULL)
	{
		cout << "ERROR : Not enough memory. EXIT !!!\n";
		exit(1);
	}
	
	// set up the initial values for an empty list
	list->first = new (std::nothrow) Node;
	if (list->first == NULL)
	{
		cout << "ERROR : Not enough memory. EXIT !!!\n";
		exit(1);
	}

	list->last = new (std::nothrow) Node;
	if (list->last == NULL)
	{
		cout << "ERROR : Not enough memory. EXIT !!!\n";
		exit(1);
	}

	list->current = list->first;
	list->leftSize = 0;
	list->rightSize = 0;
	list->first->next = list->last;
	list->last->previous = list->first;

}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x20(%rsp)
movl $0x20, %edi
movq 0x9341(%rip), %rsi      # 0xff90
callq 0x2350
movq %rax, %rcx
movq %rcx, 0x28(%rsp)
movb $0x0, 0x6f(%rsp)
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, 0x30(%rsp)
je 0x6c7d
movq 0x28(%rsp), %rax
movb $0x1, 0x6f(%rsp)
movq %rax, 0x30(%rsp)
movq 0x20(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rcx, (%rax)
cmpq $0x0, (%rax)
jne 0x6cad
movq 0x9321(%rip), %rdi      # 0xffb8
leaq 0x5366(%rip), %rsi      # 0xc004
callq 0x2140
movl $0x1, %edi
callq 0x21c0
movl $0x18, %edi
movq 0x92d7(%rip), %rsi      # 0xff90
callq 0x2350
movq %rax, %rcx
movq %rcx, 0x10(%rsp)
movb $0x0, 0x5f(%rsp)
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, 0x18(%rsp)
je 0x6cfa
movq 0x10(%rsp), %rdi
movq %rdi, 0x60(%rsp)
movb $0x1, 0x5f(%rsp)
callq 0x7360
jmp 0x6cee
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x6cfa
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rdx
movq (%rax), %rcx
movq %rdx, (%rcx)
movq (%rax), %rax
cmpq $0x0, (%rax)
jne 0x6d5d
movq 0x929e(%rip), %rdi      # 0xffb8
leaq 0x52e3(%rip), %rsi      # 0xc004
callq 0x2140
movl $0x1, %edi
callq 0x21c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
testb $0x1, 0x5f(%rsp)
jne 0x6d47
jmp 0x6d58
movq 0x60(%rsp), %rdi
movq 0x923d(%rip), %rsi      # 0xff90
callq 0x20e0
jmp 0x6e56
movl $0x18, %edi
movq 0x9227(%rip), %rsi      # 0xff90
callq 0x2350
movq %rax, %rcx
movq %rcx, (%rsp)
movb $0x0, 0x3f(%rsp)
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, 0x8(%rsp)
je 0x6da7
movq (%rsp), %rdi
movq %rdi, 0x40(%rsp)
movb $0x1, 0x3f(%rsp)
callq 0x7360
jmp 0x6d9c
movq (%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x6da7
movq 0x20(%rsp), %rax
movq 0x8(%rsp), %rdx
movq (%rax), %rcx
movq %rdx, 0x8(%rcx)
movq (%rax), %rax
cmpq $0x0, 0x8(%rax)
jne 0x6e09
movq 0x91ef(%rip), %rdi      # 0xffb8
leaq 0x5234(%rip), %rsi      # 0xc004
callq 0x2140
movl $0x1, %edi
callq 0x21c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
testb $0x1, 0x3f(%rsp)
jne 0x6df6
jmp 0x6e07
movq 0x40(%rsp), %rdi
movq 0x918e(%rip), %rsi      # 0xff90
callq 0x20e0
jmp 0x6e56
movq 0x20(%rsp), %rax
movq (%rax), %rcx
movq (%rcx), %rdx
movq (%rax), %rcx
movq %rdx, 0x10(%rcx)
movq (%rax), %rcx
movl $0x0, 0x18(%rcx)
movq (%rax), %rcx
movl $0x0, 0x1c(%rcx)
movq (%rax), %rcx
movq 0x8(%rcx), %rdx
movq (%rax), %rcx
movq (%rcx), %rcx
movq %rdx, 0x8(%rcx)
movq (%rax), %rcx
movq (%rcx), %rcx
movq (%rax), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x10(%rax)
addq $0x78, %rsp
retq
movq 0x50(%rsp), %rdi
callq 0x22b0