// File: /workspace/github_cpp_makefile_star2_O2/KitchMKelly[P]Team-9-OSU-Hackathon-Winter-2018/BawkBusterFunctions.cpp
// Function: directorSearchMain(Cart&, std::vector<Video, std::allocator<Video>>&)
void directorSearchMain(Cart& newCart, vector<Video>& videoList)
{
	vector<Video> results;		//Initialize an empty vector of movie results
	string director = "";			//Initalize new string to hold user input

	cin.clear();				//Clear bad input flag
	cin.ignore(10000, '\n');	//Discard input
	displayDirectorSearchMenu();

	getline(cin, director);		//Get user input, store in 'title'
	while (director != "0")		//As long as the user doesn't enter '0',
								//(s)he can search as many times as desired.
	{							
		//search for movie directors, return results (if any)
		directorSearchVector(videoList, results, director);
		if (results.empty())  //if results is empty, we didn't find it
		{
			clearScreen();
			cout << "Director not found\n" << endl;
		}
		else
		{
			clearScreen();
			cout << "Movies by " << director <<" found:\n";  //results now holds the movie!!
			for (int i = 0; i < results.size(); i++)
			{
				cout << i+1 << ". " << results[i].getTitle() << endl;
			}
			addToCart(newCart, results);	//User decides if (s)he wants to add the movie to the cart,
							//and continues searching.
		}
		results.clear(); //delete everything from the vector to prepare for the next search
		cout << "Please enter another director,\n"
			 << "or enter '0' to return to Main Menu." << endl;
		getline(cin, director);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, -0x50(%rbp)
movq %rdi, -0x48(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
andq $0x0, -0x30(%rbp)
leaq 0x30e8(%rip), %rsi      # 0x6645
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0x4328
movq 0x6a6c(%rip), %rdi      # 0x9fe0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
xorl %esi, %esi
callq 0x2230
movq 0x6a57(%rip), %rdi      # 0x9fe0
pushq $0xa
popq %rdx
movl $0x2710, %esi           # imm = 0x2710
callq 0x2110
callq 0x3e96
movq 0x6a3e(%rip), %rdi      # 0x9fe0
leaq -0x70(%rbp), %rsi
callq 0x2030
leaq -0x70(%rbp), %rbx
leaq -0xb0(%rbp), %r12
movq 0x6a13(%rip), %r14      # 0x9fd0
leaq -0x90(%rbp), %r15
movq %rbx, %rdi
leaq 0x2e59(%rip), %rsi      # 0x6427
callq 0x4363
testb %al, %al
je 0x3724
movq %r12, %rdi
movq %rbx, %rsi
callq 0x21e0
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movq %r12, %rdx
callq 0x3eeb
movq %r12, %rdi
callq 0x20c0
movq -0x40(%rbp), %rax
cmpq -0x38(%rbp), %rax
je 0x36c5
callq 0x28a1
movq %r14, %rdi
leaq 0x2f5f(%rip), %rsi      # 0x657a
callq 0x2180
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2170
movq %rax, %rdi
leaq 0x2e4d(%rip), %rsi      # 0x6482
callq 0x2180
xorl %ebx, %ebx
xorl %r12d, %r12d
movq -0x38(%rbp), %rax
subq -0x40(%rbp), %rax
cqto
movl $0x98, %ecx
idivq %rcx
cmpq %r12, %rax
jbe 0x36ab
leal 0x1(%r12), %esi
movq %r14, %rdi
callq 0x2240
movq %rax, %rdi
leaq 0x2e1e(%rip), %rsi      # 0x648b
callq 0x2180
movq %rax, %r13
movq -0x40(%rbp), %rsi
addq %rbx, %rsi
movq %r15, %rdi
callq 0x4e74
movq %r13, %rdi
movq %r15, %rsi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
movq %r15, %rdi
callq 0x20c0
addq $0x98, %rbx
incq %r12
jmp 0x363f
movq -0x48(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x2908
leaq -0x70(%rbp), %rbx
leaq -0xb0(%rbp), %r12
jmp 0x36e1
callq 0x28a1
movq %r14, %rdi
leaq 0x2e92(%rip), %rsi      # 0x6566
callq 0x2180
movq %rax, %rdi
callq 0x20d0
leaq -0x40(%rbp), %rdi
callq 0x4370
movq %r14, %rdi
leaq 0x2e91(%rip), %rsi      # 0x6585
callq 0x2180
movq %rax, %rdi
leaq 0x2cff(%rip), %rsi      # 0x6402
callq 0x2180
movq %rax, %rdi
callq 0x20d0
movq 0x68c9(%rip), %rdi      # 0x9fe0
movq %rbx, %rsi
callq 0x2030
jmp 0x35c4
leaq -0x70(%rbp), %rdi
callq 0x20c0
leaq -0x40(%rbp), %rdi
callq 0x2502
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x377c
jmp 0x3770
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
jmp 0x3769
jmp 0x3770
jmp 0x3770
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x20c0
jmp 0x3773
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x20c0
leaq -0x40(%rbp), %rdi
callq 0x2502
movq %rbx, %rdi
callq 0x2250