// File: hzy1754785321[P]warehouse-manage-system/menu.cpp
// Function: MenuMain::login()
Person* MenuMain::login()
{
		int id,limit=0,login=2,x,i=0;
		char passwd[32];
		Person* lg;
		cout << "\t\t\t\t\tplease input your username:" ;
		cin >> id;
		lg=pp.searchNumber(id);
		if(lg!=NULL)
		{
			//	    lg->pp=&pp;
			//		pp.readPeople();
				    lg->readstop();
	        		while(lg->getStop()>0)
					{ 	
						system("clear");
						cout << "\033[31m limit login!" << endl << "\033[31m countdown:" << "\033[37m" << lg->getStop() << endl;
						lg->subStop();
						lg->writestop();
						sleep(1);
						if(lg->getStop()==0)
						{
								lg=NULL;
								return lg;
						}
					}
				while(1)
				{
						if(limit==3)
						{
								lg->setStop10();
									while(lg->getStop()>0)
									{
											system("clear");
											cout << "\033[31m limit login!" << endl << "\033[31m countdown:" << "\033[37m" << lg->getStop() << endl;
									     	lg->subStop();
											lg->writestop();
											sleep(1);
									}
									lg=NULL;
									return lg;
						}

					cout << "\t\t\t\t\tplease input your passwd:\033[08m" ;
					cin >> passwd;
					cout << "\033[28m" ;
					cout << "\033[37m" ;
		//			cout << "3333333" << endl;
					if(strcmp(passwd,lg->getPasswd())==0)
					{
							cout << "\033[28m";
							lg->pp=&pp;
							pd.readProduct();
							lg->temp=&pd;
								//	while(login>=0)
								//	{
							 			if(lg->getTime()!=0)
												cout << "\t\t\t\t\t上次登录时间:" << lg->getTime() << endl;
										else
												cout << "\t\t\t\t\twelcome new user!" << endl;
								  //      if(login==0)
									//	{
											lg->setTime();
											lg->writeRecord();
									//		cout << "时间已记录!" << endl;
									//	}
										cout << "\t\t\t\t\t当前时间:" << lg->getTime() << "   已记录!" << endl << endl;
									//	cout << "当前时间:";
									//	showTime();
									//	while(login>0)
									//	{
										srand((unsigned)time(NULL));
										while(login>0)
										{
												x=rand()%6;
										if(x==0)
										{
											 cout << "\033[1A";
											 cout << "\033[K";
											 cout << "\t\t\t\t\t\033[31m请稍候:" << login << endl;
								    		 login--;
											 sleep(1);
										}
										if(x==1)
										{
											cout << "\033[1A";
											cout << "\033[K";
											cout << "\t\t\t\t\t\033[32m请稍候:" << login << endl;
											sleep(1);
											login--;
										}
										if(x==2)
										{
											cout << "\033[1A";
											cout << "\033[K";
											cout << "\t\t\t\t\t\033[33m请稍候:" << login << endl;
											sleep(1);
											login--;
										}
										if(x==3)
										{
											cout << "\33[1A";
											cout << "\33[K";
											cout << "\t\t\t\t\t\033[34m请稍候:" << login << endl;
											sleep(1);
											login--;
										}
										if(x==4)
										{
											cout << "\33[1A";
											cout << "\33[K";
											cout << "\t\t\t\t\t\033[35m请稍候:" << login << endl;
											sleep(1);
											login--;
										}
										if(x==5)
										{
											cout << "\33[1A";
											cout << "\33[K";
											cout << "\t\t\t\t\t\033[36m请稍候:" << login << endl;
											sleep(1);
											login--;
										}
										}
										cout << "\33[1A";
										cout << "\033[K";
									    cout << "\t\t\t\t\t\033[37m请稍候:" << login << endl;
										sleep(1);
									//			cout << "\033[1A";
									//			cout << "\033[K";
									//			cout << "\t\t\t\t\t请稍候:" << login << endl;
									//			login--;
									//			sleep(1);
								//		}
									//	system("clear");
						//	if(lg->getTime()!=0)
							   //  	cout << "上次登录时间:" << lg->getTime() << endl;
					//		else
					//				cout << "welcome new user!" << endl;
					//		lg->setTime();
					//		cout << "当前时间:" << lg->getTime() << "   已记录!" << endl;				
					//		sleep(5);
							return lg;
					}
					else
					{
							cout << "\t\t\t\t\t\033[28mpasswd error!" << endl;
							limit++;
					}
				}
		}
		else
		{
				cout << "username is NULL!" << endl;
				sleep(1);
				return lg;
		}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x2, -0x1c(%rbp)
movl $0x0, -0x24(%rbp)
movq 0x8bdd(%rip), %rdi      # 0x14fd0
leaq 0x2e81(%rip), %rsi      # 0xf27b
callq 0x21e0
movq 0x8bda(%rip), %rdi      # 0x14fe0
leaq -0x14(%rbp), %rsi
callq 0x20f0
movq -0x60(%rbp), %rdi
addq $0x10, %rdi
leaq -0x14(%rbp), %rsi
callq 0x3980
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0xcab2
movq -0x58(%rbp), %rdi
callq 0x33d0
movq -0x58(%rbp), %rdi
callq 0x2900
cmpl $0x0, %eax
jle 0xc501
leaq 0x23cf(%rip), %rdi      # 0xe820
callq 0x2190
movq 0x8b73(%rip), %rdi      # 0x14fd0
leaq 0x2ccd(%rip), %rsi      # 0xf131
callq 0x21e0
movq %rax, %rdi
movq 0x8b4d(%rip), %rsi      # 0x14fc0
callq 0x2210
movq %rax, %rdi
leaq 0x2cc2(%rip), %rsi      # 0xf144
callq 0x21e0
movq %rax, %rdi
leaq 0x2cc4(%rip), %rsi      # 0xf155
callq 0x21e0
movq %rax, -0x68(%rbp)
movq -0x58(%rbp), %rdi
callq 0x2900
movq -0x68(%rbp), %rdi
movl %eax, %esi
callq 0x2340
movq %rax, %rdi
movq 0x8b08(%rip), %rsi      # 0x14fc0
callq 0x2210
movq -0x58(%rbp), %rdi
callq 0x3080
movq -0x58(%rbp), %rdi
callq 0x32c0
movl $0x1, %edi
callq 0x2140
movq -0x58(%rbp), %rdi
callq 0x2900
cmpl $0x0, %eax
jne 0xc4fc
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xcae6
jmp 0xc438
jmp 0xc503
cmpl $0x3, -0x18(%rbp)
jne 0xc5d1
movq -0x58(%rbp), %rdi
callq 0x30a0
movq -0x58(%rbp), %rdi
callq 0x2900
cmpl $0x0, %eax
jle 0xc5bc
leaq 0x22f1(%rip), %rdi      # 0xe820
callq 0x2190
movq 0x8a95(%rip), %rdi      # 0x14fd0
leaq 0x2bef(%rip), %rsi      # 0xf131
callq 0x21e0
movq %rax, %rdi
movq 0x8a6f(%rip), %rsi      # 0x14fc0
callq 0x2210
movq %rax, %rdi
leaq 0x2be4(%rip), %rsi      # 0xf144
callq 0x21e0
movq %rax, %rdi
leaq 0x2be6(%rip), %rsi      # 0xf155
callq 0x21e0
movq %rax, -0x70(%rbp)
movq -0x58(%rbp), %rdi
callq 0x2900
movq -0x70(%rbp), %rdi
movl %eax, %esi
callq 0x2340
movq %rax, %rdi
movq 0x8a2a(%rip), %rsi      # 0x14fc0
callq 0x2210
movq -0x58(%rbp), %rdi
callq 0x3080
movq -0x58(%rbp), %rdi
callq 0x32c0
movl $0x1, %edi
callq 0x2140
jmp 0xc516
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xcae6
movq 0x89f8(%rip), %rdi      # 0x14fd0
leaq 0x2cbd(%rip), %rsi      # 0xf29c
callq 0x21e0
leaq -0x50(%rbp), %rsi
movq 0x89f1(%rip), %rdi      # 0x14fe0
callq 0x5510
movq 0x89d5(%rip), %rdi      # 0x14fd0
leaq 0x2b7c(%rip), %rsi      # 0xf17e
callq 0x21e0
movq 0x89c2(%rip), %rdi      # 0x14fd0
leaq 0x2b40(%rip), %rsi      # 0xf155
callq 0x21e0
leaq -0x50(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x58(%rbp), %rdi
callq 0x28c0
movq -0x78(%rbp), %rdi
movq %rax, %rsi
callq 0x22b0
cmpl $0x0, %eax
jne 0xca82
movq 0x8989(%rip), %rdi      # 0x14fd0
leaq 0x2b30(%rip), %rsi      # 0xf17e
callq 0x21e0
movq -0x60(%rbp), %rdi
movq %rdi, %rcx
addq $0x10, %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0xb0(%rax)
addq $0x28, %rdi
callq 0x9830
movq -0x60(%rbp), %rcx
addq $0x28, %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0xa8(%rax)
movq -0x58(%rbp), %rdi
callq 0x2bd0
cmpq $0x0, %rax
je 0xc6d1
movq 0x8935(%rip), %rdi      # 0x14fd0
leaq 0x2ae2(%rip), %rsi      # 0xf184
callq 0x21e0
movq %rax, -0x80(%rbp)
movq -0x58(%rbp), %rdi
callq 0x2bd0
movq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0x21e0
movq %rax, %rdi
movq 0x88f6(%rip), %rsi      # 0x14fc0
callq 0x2210
jmp 0xc6f3
movq 0x88f8(%rip), %rdi      # 0x14fd0
leaq 0x2abe(%rip), %rsi      # 0xf19d
callq 0x21e0
movq %rax, %rdi
movq 0x88d2(%rip), %rsi      # 0x14fc0
callq 0x2210
movq -0x58(%rbp), %rdi
callq 0x2b80
movq -0x58(%rbp), %rdi
callq 0x3f60
movq 0x88c4(%rip), %rdi      # 0x14fd0
leaq 0x2aa1(%rip), %rsi      # 0xf1b4
callq 0x21e0
movq %rax, -0x88(%rbp)
movq -0x58(%rbp), %rdi
callq 0x2bd0
movq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x21e0
movq %rax, %rdi
leaq 0x2a86(%rip), %rsi      # 0xf1c7
callq 0x21e0
movq %rax, %rdi
movq 0x8870(%rip), %rsi      # 0x14fc0
callq 0x2210
movq %rax, %rdi
movq 0x8861(%rip), %rsi      # 0x14fc0
callq 0x2210
xorl %eax, %eax
movl %eax, %edi
callq 0x21b0
movl %eax, %edi
callq 0x21d0
cmpl $0x0, -0x1c(%rbp)
jle 0xca1b
callq 0x2080
movl $0x6, %ecx
cltd
idivl %ecx
movl %edx, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jne 0xc7fa
movq 0x8835(%rip), %rdi      # 0x14fd0
leaq 0x1b9c(%rip), %rsi      # 0xe33e
callq 0x21e0
movq 0x8822(%rip), %rdi      # 0x14fd0
leaq 0x1b8e(%rip), %rsi      # 0xe343
callq 0x21e0
movq 0x880f(%rip), %rdi      # 0x14fd0
leaq 0x2a0d(%rip), %rsi      # 0xf1d5
callq 0x21e0
movq %rax, %rdi
movl -0x1c(%rbp), %esi
callq 0x2340
movq %rax, %rdi
movq 0x87de(%rip), %rsi      # 0x14fc0
callq 0x2210
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
movl $0x1, %edi
callq 0x2140
cmpl $0x1, -0x20(%rbp)
jne 0xc866
movq 0x87c9(%rip), %rdi      # 0x14fd0
leaq 0x1b30(%rip), %rsi      # 0xe33e
callq 0x21e0
movq 0x87b6(%rip), %rdi      # 0x14fd0
leaq 0x1b22(%rip), %rsi      # 0xe343
callq 0x21e0
movq 0x87a3(%rip), %rdi      # 0x14fd0
leaq 0x29b6(%rip), %rsi      # 0xf1ea
callq 0x21e0
movq %rax, %rdi
movl -0x1c(%rbp), %esi
callq 0x2340
movq %rax, %rdi
movq 0x8772(%rip), %rsi      # 0x14fc0
callq 0x2210
movl $0x1, %edi
callq 0x2140
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x2, -0x20(%rbp)
jne 0xc8d2
movq 0x875d(%rip), %rdi      # 0x14fd0
leaq 0x1ac4(%rip), %rsi      # 0xe33e
callq 0x21e0
movq 0x874a(%rip), %rdi      # 0x14fd0
leaq 0x1ab6(%rip), %rsi      # 0xe343
callq 0x21e0
movq 0x8737(%rip), %rdi      # 0x14fd0
leaq 0x295f(%rip), %rsi      # 0xf1ff
callq 0x21e0
movq %rax, %rdi
movl -0x1c(%rbp), %esi
callq 0x2340
movq %rax, %rdi
movq 0x8706(%rip), %rsi      # 0x14fc0
callq 0x2210
movl $0x1, %edi
callq 0x2140
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x3, -0x20(%rbp)
jne 0xc93e
movq 0x86f1(%rip), %rdi      # 0x14fd0
leaq 0x1a58(%rip), %rsi      # 0xe33e
callq 0x21e0
movq 0x86de(%rip), %rdi      # 0x14fd0
leaq 0x1a4a(%rip), %rsi      # 0xe343
callq 0x21e0
movq 0x86cb(%rip), %rdi      # 0x14fd0
leaq 0x2908(%rip), %rsi      # 0xf214
callq 0x21e0
movq %rax, %rdi
movl -0x1c(%rbp), %esi
callq 0x2340
movq %rax, %rdi
movq 0x869a(%rip), %rsi      # 0x14fc0
callq 0x2210
movl $0x1, %edi
callq 0x2140
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x4, -0x20(%rbp)
jne 0xc9aa
movq 0x8685(%rip), %rdi      # 0x14fd0
leaq 0x19ec(%rip), %rsi      # 0xe33e
callq 0x21e0
movq 0x8672(%rip), %rdi      # 0x14fd0
leaq 0x19de(%rip), %rsi      # 0xe343
callq 0x21e0
movq 0x865f(%rip), %rdi      # 0x14fd0
leaq 0x28b1(%rip), %rsi      # 0xf229
callq 0x21e0
movq %rax, %rdi
movl -0x1c(%rbp), %esi
callq 0x2340
movq %rax, %rdi
movq 0x862e(%rip), %rsi      # 0x14fc0
callq 0x2210
movl $0x1, %edi
callq 0x2140
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x5, -0x20(%rbp)
jne 0xca16
movq 0x8619(%rip), %rdi      # 0x14fd0
leaq 0x1980(%rip), %rsi      # 0xe33e
callq 0x21e0
movq 0x8606(%rip), %rdi      # 0x14fd0
leaq 0x1972(%rip), %rsi      # 0xe343
callq 0x21e0
movq 0x85f3(%rip), %rdi      # 0x14fd0
leaq 0x285a(%rip), %rsi      # 0xf23e
callq 0x21e0
movq %rax, %rdi
movl -0x1c(%rbp), %esi
callq 0x2340
movq %rax, %rdi
movq 0x85c2(%rip), %rsi      # 0x14fc0
callq 0x2210
movl $0x1, %edi
callq 0x2140
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xc774
movq 0x85ae(%rip), %rdi      # 0x14fd0
leaq 0x1915(%rip), %rsi      # 0xe33e
callq 0x21e0
movq 0x859b(%rip), %rdi      # 0x14fd0
leaq 0x1907(%rip), %rsi      # 0xe343
callq 0x21e0
movq 0x8588(%rip), %rdi      # 0x14fd0
leaq 0x2804(%rip), %rsi      # 0xf253
callq 0x21e0
movq %rax, %rdi
movl -0x1c(%rbp), %esi
callq 0x2340
movq %rax, %rdi
movq 0x8557(%rip), %rsi      # 0x14fc0
callq 0x2210
movl $0x1, %edi
callq 0x2140
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xcae6
movq 0x8547(%rip), %rdi      # 0x14fd0
leaq 0x2830(%rip), %rsi      # 0xf2c0
callq 0x21e0
movq %rax, %rdi
movq 0x8521(%rip), %rsi      # 0x14fc0
callq 0x2210
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xc503
movq 0x8517(%rip), %rdi      # 0x14fd0
leaq 0x2818(%rip), %rsi      # 0xf2d8
callq 0x21e0
movq %rax, %rdi
movq 0x84f1(%rip), %rsi      # 0x14fc0
callq 0x2210
movl $0x1, %edi
callq 0x2140
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)