// File: hzy1754785321[P]warehouse-manage-system/menu.cpp
// Function: MenuMain::adminLogin()
int MenuMain::adminLogin()
{
		int limit=0,login=2,x;
		Person *lg;
		char passwd[32];
		char name[32];
		cout << "\t\t\t\t\tplease input the username:" ;
		cin >> name;
	//	lg=pp.searchName(name);
		if(strcmp(name,"admin")!=0)
		{
				cout << "username error!" << endl;
				sleep(1);
				return 0;
		}//	lg=pp.searchName(name);
		lg=pp.searchName(name);
		if(lg!=NULL)
				{  
				    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)
								return 0;
					}
						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);
									}
									return 0;
							}
							cout << "\t\t\t\t\tplease input the passwd:\033[08m" ;
							cin >> passwd;
							cout << "\033[28m";
							cout << "\033[37m";
				//			cout << "passwd:" << lg->getPasswd()  << endl;
							if(strcmp(passwd,lg->getPasswd())==0)
							{
									lg->pp=&pp;
									pd.readProduct();
				          		    lg->temp=&pd;
									ps=new Admin(lg);
								//	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->readRecord();
											lg->setTime();
											lg->writeRecord();
							//				cout << "时间已记录!" << endl;
							//			}
										cout << "\t\t\t\t\t当前时间:" << lg->getTime() << "   已记录!" << endl<< endl;;
								//		cout << "当前时间:";
								//		showTime();
										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);
								//		system("clear");
									//	}
									//	cout << "welcome admin login in system" << endl;
										return 1;
							}
				
							else
							{
									cout << "\033[28m";
									cout << "\t\t\t\t\tpasswd error!" << endl;
									limit++;
							}
						}
				}

				
				else
				{
				//		cout << "11111" << endl;
						ps=new Admin;
				//		cout << "333333" << endl;
						ps->pp=&pp;
						ps->pp->push_back(ps);
						pd.readProduct();
						ps->temp=&pd;
						ps->setTime();
						return 1;
				}		
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x88(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x2, -0x18(%rbp)
movq 0x95f1(%rip), %rdi      # 0x14fd0
leaq 0x371b(%rip), %rsi      # 0xf101
callq 0x21e0
leaq -0x70(%rbp), %rsi
movq 0x95ea(%rip), %rdi      # 0x14fe0
callq 0x5510
leaq -0x70(%rbp), %rdi
leaq 0x2a12(%rip), %rsi      # 0xe418
callq 0x22b0
cmpl $0x0, %eax
je 0xba48
movq 0x95b9(%rip), %rdi      # 0x14fd0
leaq 0x3703(%rip), %rsi      # 0xf121
callq 0x21e0
movq %rax, %rdi
movq 0x9593(%rip), %rsi      # 0x14fc0
callq 0x2210
movl $0x1, %edi
callq 0x2140
movl $0x0, -0x4(%rbp)
jmp 0xc205
movq -0x88(%rbp), %rdi
addq $0x10, %rdi
leaq -0x70(%rbp), %rsi
callq 0x3a30
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xc155
movq -0x28(%rbp), %rdi
callq 0x31d0
movq -0x28(%rbp), %rdi
callq 0x2900
cmpl $0x0, %eax
jle 0xbb3a
leaq 0x2d93(%rip), %rdi      # 0xe820
callq 0x2190
movq 0x9537(%rip), %rdi      # 0x14fd0
leaq 0x3691(%rip), %rsi      # 0xf131
callq 0x21e0
movq %rax, %rdi
movq 0x9511(%rip), %rsi      # 0x14fc0
callq 0x2210
movq %rax, %rdi
leaq 0x3686(%rip), %rsi      # 0xf144
callq 0x21e0
movq %rax, %rdi
leaq 0x3688(%rip), %rsi      # 0xf155
callq 0x21e0
movq %rax, -0x90(%rbp)
movq -0x28(%rbp), %rdi
callq 0x2900
movq -0x90(%rbp), %rdi
movl %eax, %esi
callq 0x2340
movq %rax, %rdi
movq 0x94c6(%rip), %rsi      # 0x14fc0
callq 0x2210
movq -0x28(%rbp), %rdi
callq 0x3080
movq -0x28(%rbp), %rdi
callq 0x30c0
movl $0x1, %edi
callq 0x2140
movq -0x28(%rbp), %rdi
callq 0x2900
cmpl $0x0, %eax
jne 0xbb35
movl $0x0, -0x4(%rbp)
jmp 0xc205
jmp 0xba74
jmp 0xbb3c
cmpl $0x3, -0x14(%rbp)
jne 0xbc07
movq -0x28(%rbp), %rdi
callq 0x30a0
movq -0x28(%rbp), %rdi
callq 0x2900
cmpl $0x0, %eax
jle 0xbbfb
leaq 0x2cb8(%rip), %rdi      # 0xe820
callq 0x2190
movq 0x945c(%rip), %rdi      # 0x14fd0
leaq 0x35b6(%rip), %rsi      # 0xf131
callq 0x21e0
movq %rax, %rdi
movq 0x9436(%rip), %rsi      # 0x14fc0
callq 0x2210
movq %rax, %rdi
leaq 0x35ab(%rip), %rsi      # 0xf144
callq 0x21e0
movq %rax, %rdi
leaq 0x35ad(%rip), %rsi      # 0xf155
callq 0x21e0
movq %rax, -0x98(%rbp)
movq -0x28(%rbp), %rdi
callq 0x2900
movq -0x98(%rbp), %rdi
movl %eax, %esi
callq 0x2340
movq %rax, %rdi
movq 0x93eb(%rip), %rsi      # 0x14fc0
callq 0x2210
movq -0x28(%rbp), %rdi
callq 0x3080
movq -0x28(%rbp), %rdi
callq 0x30c0
movl $0x1, %edi
callq 0x2140
jmp 0xbb4f
movl $0x0, -0x4(%rbp)
jmp 0xc205
movq 0x93c2(%rip), %rdi      # 0x14fd0
leaq 0x3546(%rip), %rsi      # 0xf15b
callq 0x21e0
leaq -0x50(%rbp), %rsi
movq 0x93bb(%rip), %rdi      # 0x14fe0
callq 0x5510
movq 0x939f(%rip), %rdi      # 0x14fd0
leaq 0x3546(%rip), %rsi      # 0xf17e
callq 0x21e0
movq 0x938c(%rip), %rdi      # 0x14fd0
leaq 0x350a(%rip), %rsi      # 0xf155
callq 0x21e0
leaq -0x50(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x28(%rbp), %rdi
callq 0x28c0
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
callq 0x22b0
cmpl $0x0, %eax
jne 0xc112
movq -0x88(%rbp), %rdi
movq %rdi, %rcx
addq $0x10, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0xb0(%rax)
addq $0x28, %rdi
movq %rdi, -0xb0(%rbp)
callq 0x9830
movq -0xb0(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0xa8(%rax)
movl $0xb8, %edi
callq 0x21f0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xa8(%rbp)
movq -0x28(%rbp), %rsi
callq 0x4e60
jmp 0xbcd9
movq -0x88(%rbp), %rax
movq -0xa8(%rbp), %rcx
movq %rcx, 0x40(%rax)
movq -0x28(%rbp), %rdi
callq 0x2bd0
cmpq $0x0, %rax
je 0xbd5f
movq 0x92cf(%rip), %rdi      # 0x14fd0
leaq 0x347c(%rip), %rsi      # 0xf184
callq 0x21e0
movq %rax, -0xb8(%rbp)
movq -0x28(%rbp), %rdi
callq 0x2bd0
movq -0xb8(%rbp), %rdi
movq %rax, %rsi
callq 0x21e0
movq %rax, %rdi
movq 0x928a(%rip), %rsi      # 0x14fc0
callq 0x2210
jmp 0xbd81
movq -0xa8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
movl $0xb8, %esi
callq 0x2200
jmp 0xc211
movq 0x926a(%rip), %rdi      # 0x14fd0
leaq 0x3430(%rip), %rsi      # 0xf19d
callq 0x21e0
movq %rax, %rdi
movq 0x9244(%rip), %rsi      # 0x14fc0
callq 0x2210
movq -0x28(%rbp), %rdi
callq 0x2b80
movq -0x28(%rbp), %rdi
callq 0x3f60
movq 0x9236(%rip), %rdi      # 0x14fd0
leaq 0x3413(%rip), %rsi      # 0xf1b4
callq 0x21e0
movq %rax, -0xc0(%rbp)
movq -0x28(%rbp), %rdi
callq 0x2bd0
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x21e0
movq %rax, %rdi
leaq 0x33f8(%rip), %rsi      # 0xf1c7
callq 0x21e0
movq %rax, %rdi
movq 0x91e2(%rip), %rsi      # 0x14fc0
callq 0x2210
movq %rax, %rdi
movq 0x91d3(%rip), %rsi      # 0x14fc0
callq 0x2210
xorl %eax, %eax
movl %eax, %edi
callq 0x21b0
movl %eax, %edi
callq 0x21d0
cmpl $0x0, -0x18(%rbp)
jle 0xc0a9
callq 0x2080
movl $0x6, %ecx
cltd
idivl %ecx
movl %edx, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0xbe88
movq 0x91a7(%rip), %rdi      # 0x14fd0
leaq 0x250e(%rip), %rsi      # 0xe33e
callq 0x21e0
movq 0x9194(%rip), %rdi      # 0x14fd0
leaq 0x2500(%rip), %rsi      # 0xe343
callq 0x21e0
movq 0x9181(%rip), %rdi      # 0x14fd0
leaq 0x337f(%rip), %rsi      # 0xf1d5
callq 0x21e0
movq %rax, %rdi
movl -0x18(%rbp), %esi
callq 0x2340
movq %rax, %rdi
movq 0x9150(%rip), %rsi      # 0x14fc0
callq 0x2210
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
movl $0x1, %edi
callq 0x2140
cmpl $0x1, -0x1c(%rbp)
jne 0xbef4
movq 0x913b(%rip), %rdi      # 0x14fd0
leaq 0x24a2(%rip), %rsi      # 0xe33e
callq 0x21e0
movq 0x9128(%rip), %rdi      # 0x14fd0
leaq 0x2494(%rip), %rsi      # 0xe343
callq 0x21e0
movq 0x9115(%rip), %rdi      # 0x14fd0
leaq 0x3328(%rip), %rsi      # 0xf1ea
callq 0x21e0
movq %rax, %rdi
movl -0x18(%rbp), %esi
callq 0x2340
movq %rax, %rdi
movq 0x90e4(%rip), %rsi      # 0x14fc0
callq 0x2210
movl $0x1, %edi
callq 0x2140
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
cmpl $0x2, -0x1c(%rbp)
jne 0xbf60
movq 0x90cf(%rip), %rdi      # 0x14fd0
leaq 0x2436(%rip), %rsi      # 0xe33e
callq 0x21e0
movq 0x90bc(%rip), %rdi      # 0x14fd0
leaq 0x2428(%rip), %rsi      # 0xe343
callq 0x21e0
movq 0x90a9(%rip), %rdi      # 0x14fd0
leaq 0x32d1(%rip), %rsi      # 0xf1ff
callq 0x21e0
movq %rax, %rdi
movl -0x18(%rbp), %esi
callq 0x2340
movq %rax, %rdi
movq 0x9078(%rip), %rsi      # 0x14fc0
callq 0x2210
movl $0x1, %edi
callq 0x2140
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
cmpl $0x3, -0x1c(%rbp)
jne 0xbfcc
movq 0x9063(%rip), %rdi      # 0x14fd0
leaq 0x23ca(%rip), %rsi      # 0xe33e
callq 0x21e0
movq 0x9050(%rip), %rdi      # 0x14fd0
leaq 0x23bc(%rip), %rsi      # 0xe343
callq 0x21e0
movq 0x903d(%rip), %rdi      # 0x14fd0
leaq 0x327a(%rip), %rsi      # 0xf214
callq 0x21e0
movq %rax, %rdi
movl -0x18(%rbp), %esi
callq 0x2340
movq %rax, %rdi
movq 0x900c(%rip), %rsi      # 0x14fc0
callq 0x2210
movl $0x1, %edi
callq 0x2140
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
cmpl $0x4, -0x1c(%rbp)
jne 0xc038
movq 0x8ff7(%rip), %rdi      # 0x14fd0
leaq 0x235e(%rip), %rsi      # 0xe33e
callq 0x21e0
movq 0x8fe4(%rip), %rdi      # 0x14fd0
leaq 0x2350(%rip), %rsi      # 0xe343
callq 0x21e0
movq 0x8fd1(%rip), %rdi      # 0x14fd0
leaq 0x3223(%rip), %rsi      # 0xf229
callq 0x21e0
movq %rax, %rdi
movl -0x18(%rbp), %esi
callq 0x2340
movq %rax, %rdi
movq 0x8fa0(%rip), %rsi      # 0x14fc0
callq 0x2210
movl $0x1, %edi
callq 0x2140
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
cmpl $0x5, -0x1c(%rbp)
jne 0xc0a4
movq 0x8f8b(%rip), %rdi      # 0x14fd0
leaq 0x22f2(%rip), %rsi      # 0xe33e
callq 0x21e0
movq 0x8f78(%rip), %rdi      # 0x14fd0
leaq 0x22e4(%rip), %rsi      # 0xe343
callq 0x21e0
movq 0x8f65(%rip), %rdi      # 0x14fd0
leaq 0x31cc(%rip), %rsi      # 0xf23e
callq 0x21e0
movq %rax, %rdi
movl -0x18(%rbp), %esi
callq 0x2340
movq %rax, %rdi
movq 0x8f34(%rip), %rsi      # 0x14fc0
callq 0x2210
movl $0x1, %edi
callq 0x2140
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xbe02
movq 0x8f20(%rip), %rdi      # 0x14fd0
leaq 0x2287(%rip), %rsi      # 0xe33e
callq 0x21e0
movq 0x8f0d(%rip), %rdi      # 0x14fd0
leaq 0x2279(%rip), %rsi      # 0xe343
callq 0x21e0
movq 0x8efa(%rip), %rdi      # 0x14fd0
leaq 0x3176(%rip), %rsi      # 0xf253
callq 0x21e0
movq %rax, %rdi
movl -0x18(%rbp), %esi
callq 0x2340
movq %rax, %rdi
movq 0x8ec9(%rip), %rsi      # 0x14fc0
callq 0x2210
movl $0x1, %edi
callq 0x2140
movl $0x1, -0x4(%rbp)
jmp 0xc205
movq 0x8eb7(%rip), %rdi      # 0x14fd0
leaq 0x305e(%rip), %rsi      # 0xf17e
callq 0x21e0
movq 0x8ea4(%rip), %rdi      # 0x14fd0
leaq 0x3135(%rip), %rsi      # 0xf268
callq 0x21e0
movq %rax, %rdi
movq 0x8e7e(%rip), %rsi      # 0x14fc0
callq 0x2210
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xbb3c
movl $0xb8, %edi
callq 0x21f0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xc8(%rbp)
callq 0x4de0
jmp 0xc173
movq -0x88(%rbp), %rsi
movq -0xc8(%rbp), %rax
movq %rax, 0x40(%rsi)
movq %rsi, %rcx
addq $0x10, %rcx
movq 0x40(%rsi), %rax
movq %rcx, 0xb0(%rax)
movq 0x40(%rsi), %rax
movq 0xb0(%rax), %rdi
addq $0x40, %rsi
callq 0x5560
movq -0x88(%rbp), %rdi
addq $0x28, %rdi
callq 0x9830
movq -0x88(%rbp), %rax
movq %rax, %rdx
addq $0x28, %rdx
movq 0x40(%rax), %rcx
movq %rdx, 0xa8(%rcx)
movq 0x40(%rax), %rdi
callq 0x2b80
movl $0x1, -0x4(%rbp)
jmp 0xc205
movq -0xc8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
movl $0xb8, %esi
callq 0x2200
jmp 0xc211
movl -0x4(%rbp), %eax
addq $0xd0, %rsp
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x2350
nopw (%rax,%rax)