// File: KitchMKelly[P]Team-9-OSU-Hackathon-Winter-2018/BawkBusterFunctions.cpp
// Function: moviesInCartMain(Cart&)
void moviesInCartMain(Cart& newCart)
{
	clearScreen();
	displayMoviesInCart(newCart);
	if(newCart.getNumCart() == 0)  //Andrew: if cart is empty, return to the main menu
		return;
	cout << endl;
	cout << "You Have " << newCart.getNumCart() << " Movies in Your Cart.\n";
	cout << "The Total Price is $" << 
	std::fixed << std::setprecision(2) << newCart.getTPrice() << "\n\n";
	cout << "Would You Like to:\n";
	//cout << "	1. Check Out?\n";
	cout << "	1. Clear Cart?\n";
	cout << "	2. Remove Last Item Added?\n";
	cout << "	3. Return to Main Menu to Checkout?\n";
	//cout << "	5. Exit the Program?\n\n";  Andrew: User should only be able to exit from the main menu
	cout << "Please Enter Your Choice (1 - 3)\n";

	int choice;
	cin >> choice;
	validateCartChoice(choice);
	//Perform the desired action

	switch (choice)
	{
		/*case 1:
		{	checkOutMain(newCart);
			break;
		}*/ //Herbert:Commented Out and Instead Make the User Enter The Main Menu To Leave
		case 1:
		{
			newCart.emptyCart();
			clearScreen();
			cout << "Your cart has been cleared!\n";
			systemPause();
			break;
		}
		case 2:
		{
			newCart.unAddToCart();  //removes last video from real cart
			systemPause();
			break;
		}
		case 3:
			break; //Andrew: this will automatically return to main menu, no need to add anything here

		//Andrew: User should only be able to exit the program from the main menu so I deleted the option
	}


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
callq 0x2de0
movq -0x8(%rbp), %rdi
callq 0x5050
movq -0x8(%rbp), %rdi
callq 0x81f0
cmpl $0x0, %eax
jne 0x448d
jmp 0x45ff
movq 0x8b3c(%rip), %rdi      # 0xcfd0
movq %rdi, -0x20(%rbp)
movq 0x8b21(%rip), %rsi      # 0xcfc0
callq 0x2220
movq -0x20(%rbp), %rdi
leaq 0x515a(%rip), %rsi      # 0x9609
callq 0x21f0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x81f0
movq -0x38(%rbp), %rdi
movl %eax, %esi
callq 0x2330
movq %rax, %rdi
leaq 0x513d(%rip), %rsi      # 0x9613
callq 0x21f0
movq -0x20(%rbp), %rdi
leaq 0x5144(%rip), %rsi      # 0x962a
callq 0x21f0
movq %rax, %rdi
leaq 0x138b(%rip), %rsi      # 0x5880
callq 0x20b0
movq %rax, -0x30(%rbp)
movl $0x2, %edi
callq 0x58b0
movq -0x30(%rbp), %rdi
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %esi
callq 0x2300
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8230
movq -0x28(%rbp), %rdi
callq 0x23a0
movq %rax, %rdi
leaq 0x5108(%rip), %rsi      # 0x963f
callq 0x21f0
movq -0x20(%rbp), %rdi
leaq 0x50fb(%rip), %rsi      # 0x9642
callq 0x21f0
movq -0x20(%rbp), %rdi
leaq 0x50ff(%rip), %rsi      # 0x9656
callq 0x21f0
movq -0x20(%rbp), %rdi
leaq 0x5100(%rip), %rsi      # 0x9667
callq 0x21f0
movq -0x20(%rbp), %rdi
leaq 0x510d(%rip), %rsi      # 0x9684
callq 0x21f0
movq -0x20(%rbp), %rdi
leaq 0x5123(%rip), %rsi      # 0x96aa
callq 0x21f0
movq 0x8a4d(%rip), %rdi      # 0xcfe0
leaq -0x10(%rbp), %rsi
callq 0x2140
movl -0x10(%rbp), %edi
callq 0x51e0
movl -0x10(%rbp), %eax
movl %eax, -0x14(%rbp)
subl $0x1, %eax
je 0x45c5
jmp 0x45b1
movl -0x14(%rbp), %eax
subl $0x2, %eax
je 0x45ed
jmp 0x45bb
movl -0x14(%rbp), %eax
subl $0x3, %eax
je 0x45fd
jmp 0x45ff
movq -0x8(%rbp), %rdi
callq 0x82d0
callq 0x2de0
movq 0x89f6(%rip), %rdi      # 0xcfd0
leaq 0x50eb(%rip), %rsi      # 0x96cc
callq 0x21f0
callq 0x2e00
jmp 0x45ff
movq -0x8(%rbp), %rdi
callq 0x8310
callq 0x2e00
jmp 0x45ff
jmp 0x45ff
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)