// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %r15
movq 0x7165(%rip), %rdi      # 0xcfd0
leaq 0x328b(%rip), %rsi      # 0x90fd
callq 0x21c0
movq 0x7162(%rip), %rdi      # 0xcfe0
leaq -0x60(%rbp), %rbx
movq %rbx, %rsi
callq 0x3fc1
leaq 0x2554(%rip), %rsi      # 0x83e5
pushq $0x6
popq %rdx
movq %rbx, %rdi
callq 0x21f0
testl %eax, %eax
je 0x5ed6
movq 0x7129(%rip), %rdi      # 0xcfd0
leaq 0x326f(%rip), %rsi      # 0x911d
callq 0x21c0
movq %rax, %rdi
callq 0x20e0
pushq $0x1
popq %rdi
callq 0x2140
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10(%r15), %r12
leaq -0x60(%rbp), %rsi
movq %r12, %rdi
callq 0x3256
testq %rax, %rax
je 0x5fab
movq %rax, %rbx
movq %r12, -0x30(%rbp)
movq %r15, -0x38(%rbp)
movq %rax, %rdi
callq 0x2d8e
leaq 0x3237(%rip), %r14      # 0x9140
leaq 0x3241(%rip), %r12      # 0x9151
pushq $0x1
popq %r13
movq %rbx, %rdi
callq 0x26a8
testl %eax, %eax
jle 0x5ffb
leaq 0x28f1(%rip), %rdi      # 0x881c
callq 0x2170
movq 0x7099(%rip), %rdi      # 0xcfd0
leaq 0x31ef(%rip), %rsi      # 0x912d
callq 0x21c0
movq %rax, %rdi
callq 0x20e0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21c0
movq %rax, %rdi
movq %r12, %rsi
callq 0x21c0
movq %rax, %r15
movq %rbx, %rdi
callq 0x26a8
movq %r15, %rdi
movl %eax, %esi
callq 0x2300
movq %rax, %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x2ccc
movq %rbx, %rdi
callq 0x2ce4
movl %r13d, %edi
callq 0x2140
movq %rbx, %rdi
callq 0x26a8
testl %eax, %eax
jne 0x5f14
jmp 0x5ec3
movl $0xb8, %edi
callq 0x21d0
movq %rax, %r14
movq %rax, %rdi
callq 0x3dc4
leaq 0x40(%r15), %rsi
movq %r14, 0x40(%r15)
movq %r12, 0xb0(%r14)
movq %r12, %rdi
callq 0x3fe4
leaq 0x28(%r15), %rbx
movq %rbx, %rdi
callq 0x5346
movq 0x40(%r15), %rdi
movq %rbx, 0xa8(%rdi)
callq 0x27e4
pushq $0x1
popq %rbx
jmp 0x5ec5
pushq $0x3
popq %r12
movq 0x6fca(%rip), %r14      # 0xcfd0
leaq -0x80(%rbp), %r13
leaq 0x3169(%rip), %r15      # 0x917a
subl $0x1, %r12d
jb 0x608e
movq %r14, %rdi
leaq 0x3136(%rip), %rsi      # 0x9157
callq 0x21c0
movq 0x6fb3(%rip), %rdi      # 0xcfe0
movq %r13, %rsi
callq 0x3fc1
movq %r14, %rdi
movq %r15, %rsi
callq 0x21c0
movq %r14, %rdi
leaq 0x3107(%rip), %rsi      # 0x9151
callq 0x21c0
movq %rbx, %rdi
callq 0x2694
movq %r13, %rdi
movq %rax, %rsi
callq 0x2280
testl %eax, %eax
je 0x612f
movq %r14, %rdi
movq %r15, %rsi
callq 0x21c0
movq %r14, %rdi
leaq 0x31e5(%rip), %rsi      # 0x9264
callq 0x21c0
movq %rax, %rdi
callq 0x20e0
jmp 0x6011
movq %rbx, %rdi
callq 0x2cd6
leaq 0x30a3(%rip), %r13      # 0x9140
leaq 0x30ad(%rip), %r14      # 0x9151
pushq $0x1
popq %r15
movq %rbx, %rdi
callq 0x26a8
testl %eax, %eax
jle 0x5ec3
leaq 0x275d(%rip), %rdi      # 0x881c
callq 0x2170
movq 0x6f05(%rip), %rdi      # 0xcfd0
leaq 0x305b(%rip), %rsi      # 0x912d
callq 0x21c0
movq %rax, %rdi
callq 0x20e0
movq %rax, %rdi
movq %r13, %rsi
callq 0x21c0
movq %rax, %rdi
movq %r14, %rsi
callq 0x21c0
movq %rax, %r12
movq %rbx, %rdi
callq 0x26a8
movq %r12, %rdi
movl %eax, %esi
callq 0x2300
movq %rax, %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x2ccc
movq %rbx, %rdi
callq 0x2ce4
movl %r15d, %edi
callq 0x2140
jmp 0x60a8
movq -0x30(%rbp), %rax
movq %rax, 0xb0(%rbx)
movq -0x38(%rbp), %r15
leaq 0x28(%r15), %r14
movq %r14, %rdi
callq 0x5346
movq %r14, 0xa8(%rbx)
movl $0xb8, %edi
callq 0x21d0
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3e06
movq %r14, 0x40(%r15)
movq %rbx, %rdi
callq 0x2828
movq 0x6e54(%rip), %rdi      # 0xcfd0
testq %rax, %rax
je 0x61a0
leaq 0x2ff8(%rip), %rsi      # 0x9180
callq 0x21c0
movq %rax, %r14
movq %rbx, %rdi
callq 0x2828
movq %r14, %rdi
movq %rax, %rsi
jmp 0x61a7
leaq 0x2ff2(%rip), %rsi      # 0x9199
callq 0x21c0
movq %rax, %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x27e4
movq %rbx, %rdi
callq 0x3540
movq 0x6e05(%rip), %r14      # 0xcfd0
leaq 0x2fde(%rip), %rsi      # 0x91b0
movq %r14, %rdi
callq 0x21c0
movq %rax, %r15
movq %rbx, %rdi
callq 0x2828
movq %r15, %rdi
movq %rax, %rsi
callq 0x21c0
leaq 0x2fcc(%rip), %rsi      # 0x91c3
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20e0
movq %rax, %rdi
callq 0x20e0
xorl %edi, %edi
callq 0x2190
movl %eax, %edi
callq 0x21b0
pushq $0x2
popq %r15
pushq $0x6
popq %r12
leaq 0x2504(%rip), %r13      # 0x8730
pushq $0x1
popq %rbx
testl %r15d, %r15d
jle 0x6377
callq 0x2080
cltd
idivl %r12d
cmpl $0x5, %edx
ja 0x622f
movslq (%r13,%rdx,4), %rax
addq %r13, %rax
jmpq *%rax
movq %r14, %rdi
leaq 0x20b1(%rip), %rsi      # 0x830b
callq 0x21c0
movq %r14, %rdi
leaq 0x20a7(%rip), %rsi      # 0x8310
callq 0x21c0
movq %r14, %rdi
leaq 0x2f59(%rip), %rsi      # 0x91d1
jmp 0x6350
movq %r14, %rdi
leaq 0x2084(%rip), %rsi      # 0x830b
callq 0x21c0
movq %r14, %rdi
leaq 0x207a(%rip), %rsi      # 0x8310
callq 0x21c0
movq %r14, %rdi
leaq 0x2f80(%rip), %rsi      # 0x9225
jmp 0x6350
movq %r14, %rdi
leaq 0x2057(%rip), %rsi      # 0x830b
callq 0x21c0
movq %r14, %rdi
leaq 0x204d(%rip), %rsi      # 0x8310
callq 0x21c0
movq %r14, %rdi
leaq 0x2f29(%rip), %rsi      # 0x91fb
jmp 0x6350
movq %r14, %rdi
leaq 0x202d(%rip), %rsi      # 0x830b
callq 0x21c0
movq %r14, %rdi
leaq 0x2023(%rip), %rsi      # 0x8310
callq 0x21c0
movq %r14, %rdi
leaq 0x2f14(%rip), %rsi      # 0x9210
jmp 0x6350
movq %r14, %rdi
leaq 0x2003(%rip), %rsi      # 0x830b
callq 0x21c0
movq %r14, %rdi
leaq 0x1ff9(%rip), %rsi      # 0x8310
callq 0x21c0
movq %r14, %rdi
leaq 0x2ec0(%rip), %rsi      # 0x91e6
jmp 0x6350
movq %r14, %rdi
leaq 0x1fd9(%rip), %rsi      # 0x830b
callq 0x21c0
movq %r14, %rdi
leaq 0x1fcf(%rip), %rsi      # 0x8310
callq 0x21c0
movq %r14, %rdi
leaq 0x2eea(%rip), %rsi      # 0x923a
callq 0x21c0
movq %rax, %rdi
movl %r15d, %esi
callq 0x2300
movq %rax, %rdi
callq 0x20e0
movl %ebx, %edi
callq 0x2140
decl %r15d
jmp 0x622f
movq 0x6c52(%rip), %r14      # 0xcfd0
leaq 0x1f86(%rip), %rsi      # 0x830b
movq %r14, %rdi
callq 0x21c0
leaq 0x1f7c(%rip), %rsi      # 0x8310
movq %r14, %rdi
callq 0x21c0
leaq 0x2eac(%rip), %rsi      # 0x924f
movq %r14, %rdi
callq 0x21c0
movq %rax, %rdi
movl %r15d, %esi
callq 0x2300
movq %rax, %rdi
callq 0x20e0
movl %ebx, %edi
callq 0x2140
jmp 0x5ec5
jmp 0x63cc
movq %rax, %rbx
movl $0xb8, %esi
movq %r14, %rdi
callq 0x21e0
movq %rbx, %rdi
callq 0x2310