// File: czmccrory[P]ManchesterBaby/baby.cpp
// Function: ManchesterBaby::menu()
void ManchesterBaby::menu() {
  int choice;
  bool isValid;
  do{
  	isValid = true;
  cout << "Manchester Baby:\n" << endl;
  cout << "1. Run Manchester Baby Simulation\n" << endl;
  cout << "2. Double memory capacity\n" << endl;
  cout << "3. Exit" <<endl;
  cin >> choice;
  if(choice == 1) {
  	try { 
      //if there is an error while running the baby catch it
      //it will most likely be because there's not enough memory
	  	if (hasParam) {
	  		cout <<paramfile<<endl;
	  		runBaby(paramfile); //if a filename was provided run the baby with this file
	  	} else {
	    	runBaby();
	  	}	
  	} catch (...) {
  		cerr <<"Some error occured. The Manchester Baby may have run out of memory." <<endl;
  	}
  } 
  else if(choice == 2) {
    extHWare();
    isValid = false; //it is still valid but I want it to go to the loop again
  }else if(choice ==3){
    cout << "Exiting" <<endl;
    exit(0);
  }else {
    cout<< "" <<endl;
    cout << "Please enter a valid value" << endl;
    cin.clear();
    cin.ignore();
    isValid=false;
  }
  }while(isValid==false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movb $0x1, -0xd(%rbp)
movq 0xaa91(%rip), %rdi      # 0xffc0
leaq 0x5cf0(%rip), %rsi      # 0xb226
callq 0x3210
movq %rax, %rdi
movq 0xaa6b(%rip), %rsi      # 0xffb0
callq 0x3240
movq 0xaa6f(%rip), %rdi      # 0xffc0
leaq 0x5ce0(%rip), %rsi      # 0xb238
callq 0x3210
movq %rax, %rdi
movq 0xaa49(%rip), %rsi      # 0xffb0
callq 0x3240
movq 0xaa4d(%rip), %rdi      # 0xffc0
leaq 0x5ce1(%rip), %rsi      # 0xb25b
callq 0x3210
movq %rax, %rdi
movq 0xaa27(%rip), %rsi      # 0xffb0
callq 0x3240
movq 0xaa2b(%rip), %rdi      # 0xffc0
leaq 0x5cda(%rip), %rsi      # 0xb276
callq 0x3210
movq %rax, %rdi
movq 0xaa05(%rip), %rsi      # 0xffb0
callq 0x3240
movq 0xaa21(%rip), %rdi      # 0xffd8
leaq -0xc(%rbp), %rsi
callq 0x3140
cmpl $0x1, -0xc(%rbp)
jne 0x56b9
movq -0x48(%rbp), %rax
testb $0x1, 0x78(%rax)
je 0x5692
movq -0x48(%rbp), %rsi
addq $0x58, %rsi
movq 0xa9d9(%rip), %rdi      # 0xffc0
callq 0x3200
movq %rax, -0x50(%rbp)
jmp 0x55f2
movq -0x50(%rbp), %rdi
movq 0xa9b3(%rip), %rsi      # 0xffb0
callq 0x3240
jmp 0x5604
movq -0x48(%rbp), %rsi
addq $0x58, %rsi
leaq -0x40(%rbp), %rdi
callq 0x30e0
jmp 0x5617
movq -0x48(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x5020
jmp 0x5626
leaq -0x40(%rbp), %rdi
callq 0x3150
jmp 0x569f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x5654
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3150
movq -0x18(%rbp), %rdi
callq 0x30d0
movq 0xa98c(%rip), %rdi      # 0xfff0
leaq 0x5c13(%rip), %rsi      # 0xb27e
callq 0x3210
movq %rax, -0x58(%rbp)
jmp 0x5676
movq -0x58(%rbp), %rdi
movq 0xa92f(%rip), %rsi      # 0xffb0
callq 0x3240
jmp 0x5688
callq 0x33a0
jmp 0x5774
movq -0x48(%rbp), %rdi
callq 0x5140
jmp 0x569d
jmp 0x569f
jmp 0x568d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x33a0
jmp 0x56b4
jmp 0x578d
cmpl $0x2, -0xc(%rbp)
jne 0x56d1
movq -0x48(%rbp), %rdi
callq 0x45b0
movb $0x0, -0xd(%rbp)
jmp 0x5772
cmpl $0x3, -0xc(%rbp)
jne 0x5700
movq 0xa8e2(%rip), %rdi      # 0xffc0
leaq 0x5bdd(%rip), %rsi      # 0xb2c2
callq 0x3210
movq %rax, %rdi
movq 0xa8bc(%rip), %rsi      # 0xffb0
callq 0x3240
xorl %edi, %edi
callq 0x32c0
movq 0xa8b9(%rip), %rdi      # 0xffc0
leaq 0x59f8(%rip), %rsi      # 0xb106
callq 0x3210
movq %rax, %rdi
movq 0xa893(%rip), %rsi      # 0xffb0
callq 0x3240
movq 0xa897(%rip), %rdi      # 0xffc0
leaq 0x5b9a(%rip), %rsi      # 0xb2ca
callq 0x3210
movq %rax, %rdi
movq 0xa871(%rip), %rsi      # 0xffb0
callq 0x3240
movq 0xa88d(%rip), %rax      # 0xffd8
movq (%rax), %rax
movq 0xa883(%rip), %rdi      # 0xffd8
addq -0x18(%rax), %rdi
xorl %esi, %esi
callq 0x33b0
movq 0xa871(%rip), %rdi      # 0xffd8
callq 0x3420
movb $0x0, -0xd(%rbp)
jmp 0x5772
jmp 0x5774
jmp 0x5776
movb -0xd(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x5524
addq $0x60, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x33e0
movq %rax, %rdi
callq 0x5e80
nop