// File: /workspace/github_cpp_makefile_star2_O1/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, %r13
movq 0xcb95(%rip), %rdi      # 0xefd0
leaq 0x8c6f(%rip), %rsi      # 0xb0b1
pushq $0x1f
popq %rdx
callq 0x2240
movq 0xcb8f(%rip), %rbx      # 0xefe0
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq 0x10(%rbx,%rax), %r14
leaq -0x60(%rbp), %rsi
pushq $0x20
popq %rdx
movq %rbx, %rdi
callq 0x2330
movq (%rbx), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x20(%rbx,%rax)
jne 0x24a1
addq $-0x21, %r14
cmpq $-0x21, %r14
ja 0x24a1
movq 0xcb55(%rip), %rcx      # 0xefe0
movq 0xe8(%rcx,%rax), %rdi
movq 0x10(%rdi), %rax
cmpq 0x18(%rdi), %rax
jae 0x2e07
leaq 0x7f50(%rip), %rsi      # 0xa3f8
leaq -0x60(%rbp), %rdi
pushq $0x6
popq %rdx
callq 0x2200
testl %eax, %eax
je 0x2513
leaq 0x8c12(%rip), %rsi      # 0xb0d1
pushq $0xf
popq %rdx
movq 0xcb07(%rip), %rbx      # 0xefd0
movq %rbx, %rdi
callq 0x2240
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
pushq $0xa
popq %rsi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
pushq $0x1
popq %rdi
callq 0x2130
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10(%r13), %rdi
leaq -0x60(%rbp), %rsi
movq %rdi, -0x30(%rbp)
callq 0x436e
testq %rax, %rax
movq 0xcaa2(%rip), %rbx      # 0xefd0
je 0x262b
movq %rax, %r15
movq %r13, -0x38(%rbp)
movq %rax, %rdi
callq 0x3ca6
leaq 0x8286(%rip), %r12      # 0xa7d0
pushq $0xa
popq %r13
movq %r15, %rdi
callq 0x31f0
testl %eax, %eax
jle 0x266a
movq %r12, %rdi
callq 0x2170
movq %rbx, %rdi
leaq 0x8b71(%rip), %rsi      # 0xb0e1
pushq $0x12
popq %rdx
callq 0x2240
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl %r13d, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq %rax, %r14
movq %rax, %rdi
leaq 0x8b4a(%rip), %rsi      # 0xb0f4
pushq $0x10
popq %rdx
callq 0x2240
movq %r14, %rdi
leaq 0x8b49(%rip), %rsi      # 0xb105
pushq $0x5
popq %rdx
callq 0x2240
movq %r15, %rdi
callq 0x31f0
movq %r14, %rdi
movl %eax, %esi
callq 0x2340
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl %r13d, %esi
callq 0x21c0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq %r15, %rdi
callq 0x3b8e
movq %r15, %rdi
callq 0x3ba6
pushq $0x1
popq %rdi
callq 0x2130
movq %r15, %rdi
callq 0x31f0
testl %eax, %eax
jne 0x254e
jmp 0x24fe
movl $0xb8, %edi
callq 0x21e0
movq %rax, %r14
movq %rax, %rdi
callq 0x5562
movq %r14, 0x40(%r13)
movq -0x30(%rbp), %rdi
movq %rdi, 0xb0(%r14)
movq 0x18(%r13), %rsi
cmpq 0x20(%r13), %rsi
je 0x2938
movq %r14, (%rsi)
addq $0x8, 0x18(%r13)
jmp 0x2941
pushq $0x3
popq %r13
leaq 0x8ab9(%rip), %r14      # 0xb12e
movq %r14, %r12
movq %rbx, %rdi
leaq 0x8a89(%rip), %rsi      # 0xb10b
pushq $0x22
popq %rdx
callq 0x2240
movq 0xc94f(%rip), %rbx      # 0xefe0
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq 0x10(%rbx,%rax), %r14
movq %rbx, %rdi
leaq -0x80(%rbp), %rsi
pushq $0x20
popq %rdx
callq 0x2330
movq (%rbx), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x20(%rbx,%rax)
jne 0x26e1
addq $-0x21, %r14
cmpq $-0x21, %r14
ja 0x26e1
movq 0xc915(%rip), %rcx      # 0xefe0
movq 0xe8(%rcx,%rax), %rdi
movq 0x10(%rdi), %rax
cmpq 0x18(%rdi), %rax
jae 0x277e
movq 0xc8e8(%rip), %rbx      # 0xefd0
movq %rbx, %rdi
movq %r12, %r14
movq %r12, %rsi
pushq $0x5
popq %r12
movq %r12, %rdx
callq 0x2240
movq %rbx, %rdi
leaq 0x89fe(%rip), %rsi      # 0xb105
movq %r12, %rdx
callq 0x2240
movq %r15, %rdi
callq 0x31dc
leaq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0x22a0
testl %eax, %eax
je 0x27b0
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2240
movq %rbx, %rdi
leaq 0x8ad5(%rip), %rsi      # 0xb218
pushq $0x12
popq %rdx
callq 0x2240
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
pushq $0xa
popq %rsi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
decl %r13d
jne 0x2675
jmp 0x2848
movq (%rdi), %rax
callq *0x48(%rax)
cmpl $-0x1, %eax
jne 0x26e1
movq 0xc84c(%rip), %rcx      # 0xefe0
movq (%rcx), %rax
movq -0x18(%rax), %rax
leaq (%rcx,%rax), %rdi
movl 0x20(%rcx,%rax), %esi
orl $0x2, %esi
callq 0x2310
jmp 0x26e1
movq -0x30(%rbp), %rax
movq %rax, 0xb0(%r15)
movq -0x38(%rbp), %r12
leaq 0x28(%r12), %r14
movq %r14, %rdi
callq 0x7008
movq %r14, 0xa8(%r15)
movl $0xb8, %edi
callq 0x21e0
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x562e
movq %r14, 0x40(%r12)
movq %r15, %rdi
callq 0x33e6
testq %rax, %rax
je 0x2966
movq 0xc7c8(%rip), %r14      # 0xefd0
leaq 0x8925(%rip), %rsi      # 0xb134
pushq $0x18
popq %rdx
movq %r14, %rdi
callq 0x2240
movq %r15, %rdi
callq 0x33e6
testq %rax, %rax
je 0x297e
movq %rax, %r12
movq %rax, %rdi
callq 0x20c0
movq 0xc793(%rip), %rdi      # 0xefd0
movq %r12, %rsi
movq %rax, %rdx
jmp 0x2977
movq %r15, %rdi
callq 0x3b98
movq %r15, %rdi
callq 0x31f0
xorl %r14d, %r14d
testl %eax, %eax
jle 0x2501
pushq $0xa
popq %r13
leaq 0x7f62(%rip), %rdi      # 0xa7d0
callq 0x2170
movq %rbx, %rdi
leaq 0x8864(%rip), %rsi      # 0xb0e1
pushq $0x12
popq %rdx
callq 0x2240
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl %r13d, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq %rax, %r12
movq %rax, %rdi
leaq 0x883d(%rip), %rsi      # 0xb0f4
pushq $0x10
popq %rdx
callq 0x2240
movq %r12, %rdi
leaq 0x883c(%rip), %rsi      # 0xb105
pushq $0x5
popq %rdx
callq 0x2240
movq %r15, %rdi
callq 0x31f0
movq %r12, %rdi
movl %eax, %esi
callq 0x2340
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl %r13d, %esi
callq 0x21c0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq %r15, %rdi
callq 0x3b8e
movq %r15, %rdi
callq 0x3ba6
pushq $0x1
popq %rdi
callq 0x2130
movq %r15, %rdi
callq 0x31f0
testl %eax, %eax
jg 0x2867
jmp 0x2501
leaq 0x40(%r13), %rdx
callq 0x5946
leaq 0x28(%r13), %rbx
movq %rbx, %rdi
callq 0x7008
movq 0x40(%r13), %rdi
movq %rbx, 0xa8(%rdi)
callq 0x33a0
pushq $0x1
popq %r14
jmp 0x2501
movq 0xc663(%rip), %rdi      # 0xefd0
leaq 0x87d9(%rip), %rsi      # 0xb14d
pushq $0x16
popq %rdx
callq 0x2240
jmp 0x2996
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x2310
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
pushq $0xa
popq %rsi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq %r15, %rdi
callq 0x33a0
movq %r15, %rdi
callq 0x4742
leaq 0x8792(%rip), %rsi      # 0xb164
pushq $0x12
popq %rdx
movq %rbx, %rdi
callq 0x2240
movq %r15, %rdi
callq 0x33e6
testq %rax, %rax
je 0x2a09
movq %rax, %r14
movq %rax, %rdi
callq 0x20c0
movq 0xc5d4(%rip), %rdi      # 0xefd0
movq %r14, %rsi
movq %rax, %rdx
callq 0x2240
jmp 0x2a20
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x2310
leaq 0x8750(%rip), %rsi      # 0xb177
pushq $0xd
popq %rdx
movq %rbx, %rdi
callq 0x2240
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
pushq $0xa
popq %r15
movl %r15d, %esi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl %r15d, %esi
callq 0x21c0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
xorl %edi, %edi
callq 0x2190
movl %eax, %edi
callq 0x21b0
pushq $0x2
popq %r12
pushq $0x1
popq %r14
callq 0x2090
cltd
pushq $0x6
popq %rcx
idivl %ecx
movl %edx, %r15d
testl %edx, %edx
jne 0x2b1f
movq %rbx, %rdi
leaq 0x7869(%rip), %rsi      # 0xa31e
pushq $0x4
popq %rdx
callq 0x2240
movq %rbx, %rdi
leaq 0x785c(%rip), %rsi      # 0xa323
pushq $0x3
popq %rdx
callq 0x2240
movq %rbx, %rdi
leaq 0x86ac(%rip), %rsi      # 0xb185
pushq $0x14
popq %rdx
callq 0x2240
movq %rbx, %rdi
movl %r12d, %esi
callq 0x2340
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
pushq $0xa
popq %rsi
callq 0x21c0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
decl %r12d
movl %r14d, %edi
callq 0x2130
cmpl $0x1, %r15d
jne 0x2b99
movq %rbx, %rdi
leaq 0x77ef(%rip), %rsi      # 0xa31e
pushq $0x4
popq %rdx
callq 0x2240
movq %rbx, %rdi
leaq 0x77e2(%rip), %rsi      # 0xa323
pushq $0x3
popq %rdx
callq 0x2240
movq %rbx, %rdi
leaq 0x8647(%rip), %rsi      # 0xb19a
pushq $0x14
popq %rdx
callq 0x2240
movq %rbx, %rdi
movl %r12d, %esi
callq 0x2340
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
pushq $0xa
popq %rsi
callq 0x21c0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movl %r14d, %edi
callq 0x2130
decl %r12d
cmpl $0x2, %r15d
jne 0x2c13
movq %rbx, %rdi
leaq 0x7775(%rip), %rsi      # 0xa31e
pushq $0x4
popq %rdx
callq 0x2240
movq %rbx, %rdi
leaq 0x7768(%rip), %rsi      # 0xa323
pushq $0x3
popq %rdx
callq 0x2240
movq %rbx, %rdi
leaq 0x85e2(%rip), %rsi      # 0xb1af
pushq $0x14
popq %rdx
callq 0x2240
movq %rbx, %rdi
movl %r12d, %esi
callq 0x2340
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
pushq $0xa
popq %rsi
callq 0x21c0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movl %r14d, %edi
callq 0x2130
decl %r12d
cmpl $0x3, %r15d
jne 0x2c8d
movq %rbx, %rdi
leaq 0x76fb(%rip), %rsi      # 0xa31e
pushq $0x4
popq %rdx
callq 0x2240
movq %rbx, %rdi
leaq 0x76ee(%rip), %rsi      # 0xa323
pushq $0x3
popq %rdx
callq 0x2240
movq %rbx, %rdi
leaq 0x857d(%rip), %rsi      # 0xb1c4
pushq $0x14
popq %rdx
callq 0x2240
movq %rbx, %rdi
movl %r12d, %esi
callq 0x2340
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
pushq $0xa
popq %rsi
callq 0x21c0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movl %r14d, %edi
callq 0x2130
decl %r12d
cmpl $0x4, %r15d
jne 0x2d07
movq %rbx, %rdi
leaq 0x7681(%rip), %rsi      # 0xa31e
pushq $0x4
popq %rdx
callq 0x2240
movq %rbx, %rdi
leaq 0x7674(%rip), %rsi      # 0xa323
pushq $0x3
popq %rdx
callq 0x2240
movq %rbx, %rdi
leaq 0x8518(%rip), %rsi      # 0xb1d9
pushq $0x14
popq %rdx
callq 0x2240
movq %rbx, %rdi
movl %r12d, %esi
callq 0x2340
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
pushq $0xa
popq %rsi
callq 0x21c0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movl %r14d, %edi
callq 0x2130
decl %r12d
cmpl $0x5, %r15d
jne 0x2d81
movq %rbx, %rdi
leaq 0x7607(%rip), %rsi      # 0xa31e
pushq $0x4
popq %rdx
callq 0x2240
movq %rbx, %rdi
leaq 0x75fa(%rip), %rsi      # 0xa323
pushq $0x3
popq %rdx
callq 0x2240
movq %rbx, %rdi
leaq 0x84b3(%rip), %rsi      # 0xb1ee
pushq $0x14
popq %rdx
callq 0x2240
movq %rbx, %rdi
movl %r12d, %esi
callq 0x2340
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
pushq $0xa
popq %rsi
callq 0x21c0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movl %r14d, %edi
callq 0x2130
decl %r12d
testl %r12d, %r12d
jg 0x2a99
movq 0xc23f(%rip), %rbx      # 0xefd0
leaq 0x7586(%rip), %rsi      # 0xa31e
pushq $0x4
popq %rdx
movq %rbx, %rdi
callq 0x2240
leaq 0x7579(%rip), %rsi      # 0xa323
pushq $0x3
popq %rdx
movq %rbx, %rdi
callq 0x2240
leaq 0x8447(%rip), %rsi      # 0xb203
pushq $0x14
popq %rdx
movq %rbx, %rdi
callq 0x2240
movq %rbx, %rdi
movl %r12d, %esi
callq 0x2340
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
pushq $0xa
popq %rsi
callq 0x21c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2110
movl %r14d, %edi
callq 0x2130
jmp 0x2501
movq (%rdi), %rax
callq *0x48(%rax)
cmpl $-0x1, %eax
jne 0x24a1
movq 0xc1c3(%rip), %rcx      # 0xefe0
movq (%rcx), %rax
movq -0x18(%rax), %rax
leaq (%rcx,%rax), %rdi
movl 0x20(%rcx,%rax), %esi
orl $0x2, %esi
callq 0x2310
jmp 0x24a1
jmp 0x2e3b
movq %rax, %rbx
movl $0xb8, %esi
movq %r14, %rdi
callq 0x21f0
movq %rbx, %rdi
callq 0x2350