// File: /workspace/github_cpp_makefile_star2_O2/asdfz1346[P]MyServer/MyServer.cpp
// Function: MyServer::worker_thread_proc(void*)
void *MyServer::worker_thread_proc(void *args){

	MyServer *pthis =((ARG*)args)->p;
	//StoC stoc;
	char rcv_buf[SND_BUF_SIZE];
	char snd_buf[RCV_BUF_SIZE];
	while(pthis->nstop){
		pthread_mutex_lock(&pthis->clientlist_mutex);
		if(!pthis->clientlist.empty()){
       			MYSQL *m_conn = mysql_init(NULL);
	        	MYSQL *m_sql = mysql_real_connect(m_conn,"localhost","root","a123456","PARKING",0,NULL,0);
		        if(!m_sql)
			        printf("connect mysql fail\n");
			
			memset(rcv_buf,0,sizeof rcv_buf);
			memset(snd_buf, 0,sizeof snd_buf);
			/*lock clientlist*/

			int fd = pthis->clientlist.front();
			pthis->clientlist.pop_front();
			pthread_mutex_unlock(&pthis->clientlist_mutex);
			
			/*recv CtoS msg*/
			int num_rcv=0;
			int allnum_rcv=0;
			while((num_rcv=recv(fd,&rcv_buf,sizeof rcv_buf,0))>=0){
        			allnum_rcv+=num_rcv;	
        			CtoS ctos;
        			memset(&ctos,0,sizeof ctos);
        			memcpy(&ctos,rcv_buf,sizeof rcv_buf);
        			//printf("fd:%d cmd:%dparkid:%dcarid:%s\n",fd,ctos.cmd,ctos.parkid,ctos.carid);
        			StoC stoc;
        			memset(&stoc,0,sizeof stoc);

				if(ctos.cmd==0){//==0
        				pthread_mutex_lock(&pthis->clientset_mutex);
        				pthis->clientset.erase(fd);
        				pthread_mutex_unlock(&pthis->clientset_mutex);
       					struct epoll_event e;
       					memset (&e,0,sizeof e);
       					e.data.fd = fd;
					e.events=EPOLLIN;
       					epoll_ctl(pthis->epollfd, EPOLL_CTL_DEL, fd,&e);
       					close(fd);
					printf("duanlian");
				}
        			/*putin*/
        			if(ctos.cmd==PUTIN){
        				/*putin(1,'S3','S4');*/
        				std::string S1 = "call putin(";
        				std::string S2 = std::to_string(ctos.parkid);
        				std::string S3 = ctos.carid;
        				std::string S4 = ctos.tele;
        				S1 = S1+S2+",'"+S3+"','"+S4+"');";
        
        				if(!mysql_query(m_sql,const_cast<char *>(S1.c_str()))){
        					stoc.cmd =PUTINSUCCESS;
        					memcpy(snd_buf,&stoc,sizeof stoc);
        					send(fd,&snd_buf,sizeof snd_buf,0);
        					//printf("putinsuccess\n");
        				}
        				else{
						//call putinupdate(1,'345');
						S1 = "call putinupdate(";
						S1 += std::to_string(ctos.parkid);
						S1+=",'";
						S1 += ctos.carid;
						S1 +="');";
						mysql_close(m_sql);
						MYSQL *m_conn = mysql_init(NULL);
						MYSQL *m_sql = mysql_real_connect(m_conn,"localhost","root","a123456","PARKING",0,NULL,0);

						if(!mysql_query(m_sql,const_cast<char *>(S1.c_str()))){
							std::cout << S1.c_str()<<std::endl;
							stoc.cmd =PUTINSUCCESS;
                                        	        memcpy(snd_buf,&stoc,sizeof stoc);
	   						send(fd,&snd_buf,sizeof snd_buf,0);
						}else{
        						stoc.cmd =PUTINFAIL;
        						memcpy(snd_buf,&stoc,sizeof snd_buf);
        						send(fd,&snd_buf,sizeof snd_buf,0);
        						//printf("putinfail\n");
						}
        				}
        
        				//sql_res = mysql_store_result(&m_sql);
        			}
        			if(ctos.cmd==PUTOUT){
        				//putout(1,'carid');
        				std::string S1 = "call putout(";
        				std::string S2 = std::to_string(ctos.parkid);
        				std::string S3 = ctos.carid;
        				S1 = S1+S2+",'"+S3+"');";
					stoc.cmd = PUTOUTFAIL;
        				if(!mysql_query(m_sql,const_cast<char *>(S1.c_str()))){
        					MYSQL_RES *result;
        					MYSQL_ROW row;
        					result = mysql_store_result(m_sql);
        					if(result!=NULL) {
        						//int num;
        						//num= mysql_num_fields(result);	
        						while((row = mysql_fetch_row(result))){
        							stoc.cmd = PUTOUTSUCCESS;
        							memcpy(stoc.carid, ctos.carid,sizeof ctos.carid);
        							if(row[0]!=NULL)
        								memcpy(stoc.ordertime,row[0],16);
        							if(row[1]!=NULL)
        								memcpy(stoc.intime,row[1],16);
        							if(row[2]!=NULL)
        								memcpy(stoc.outtime,row[2],16);
        							memcpy(snd_buf,&stoc,sizeof snd_buf); 
        						}
        						mysql_free_result(result);
        					}
        
        				}
        				else{	
        					memcpy(snd_buf,&stoc,sizeof snd_buf);
        				}
        				send(fd,&snd_buf,sizeof snd_buf,0);
        
        			}
        			if(ctos.cmd==ORDER){
        				//call porder(1,'carid','tele');
        				std::string S1 = "call porder(";
                                        std::string S2 = std::to_string(ctos.parkid);
                                        std::string S3 = ctos.carid;
                                        std::string S4 = ctos.tele;
                                        S1 = S1+S2+",'"+S3+"','"+S4+"');";
        				if(!mysql_query(m_sql,const_cast<char *>(S1.c_str()))){  
        					stoc.cmd = ORDERSUCCESS;
        				}else
        					stoc.cmd = ORDERFAIL;
        				memcpy(snd_buf,&stoc,sizeof stoc);
        				send(fd,&stoc,sizeof stoc,0);
        			}
        			if(ctos.cmd==RESET){
        				//call reset(1);
        				std::string S1 = "call reset(";
        				std::string S2 =std::to_string(ctos.parkid);
        				std::string S3 = ");";
        				S1 = S1+S2+S3;
        				if(!mysql_query(m_sql,const_cast<char *>(S1.c_str()))){
        					stoc.cmd = RESETSUCCESS;
        				}else
        					stoc.cmd = RESETFAIL;
        				memcpy(snd_buf,&stoc,sizeof stoc);
        				send(fd,&stoc,sizeof stoc,0);
        			}
        			if(ctos.cmd ==QUERY){
        				//SELECT * FROM PARKING-LOT-1;
        				std::string S1 ="SELECT * FROM parking_lot_";
        				std::string S2 = std::to_string(ctos.parkid);
        				S1 = S1+S2+" ;";
        				if(!mysql_query(m_sql,const_cast<char *>(S1.c_str()))){
        					MYSQL_RES *result;
        					MYSQL_ROW row;
        					result = mysql_store_result(m_sql);
        					while((row = mysql_fetch_row(result))){
        						memset(&stoc,0,sizeof stoc);
        						stoc.cmd=QUERYBACK;
        						if(row[0]!=NULL)//carid
        							memcpy(stoc.carid,row[0],sizeof stoc.carid );
        						if(row[1]!=NULL)//tele
        							memcpy(stoc.tele,row[1],sizeof stoc.tele);
        						if(row[2]!=NULL)//ordertime
        							memcpy(stoc.ordertime,row[2],sizeof stoc.ordertime);
        						if(row[3]!=NULL)//intime
        							memcpy(stoc.intime,row[3],sizeof stoc.intime);
        						if(row[4]!=NULL)//outtime
        							memcpy(stoc.outtime,row[4],sizeof stoc.outtime);
        						memset(snd_buf,0,sizeof snd_buf);
        						memcpy(snd_buf,&stoc,sizeof snd_buf);
							send(fd,&snd_buf,sizeof snd_buf,0);
							
        					}
						if(result!=NULL)
							mysql_free_result(result);
						stoc.cmd = QUERYOUT;
						memcpy(snd_buf,&stoc,sizeof stoc);
					        send(fd,&snd_buf,sizeof snd_buf,0);	
        				}
        				else{
        					stoc.cmd = QUERYFAIL;
        					send(fd,&snd_buf,sizeof snd_buf,0);
        				}
        			}
				if(ctos.cmd == registe){
					std::string S1 = "INSERT INTO user (user_id,user_password) VALUE ('";
					S1+=ctos.carid;
					S1+="','";
					S1+=ctos.tele;
					S1+="');";
					mysql_query(m_sql,const_cast<char *>(S1.c_str()));
				}
				if(ctos.cmd==login){
					std::string S1 = "SELECT user_password from user where user_id='";
					S1+= ctos.carid;
					S1+="';";
					mysql_query(m_sql,const_cast<char *>(S1.c_str()));
					MYSQL_RES *result;
					MYSQL_ROW row;			
					result = mysql_store_result(m_sql);
					stoc.cmd= loginfail;
					if(row = mysql_fetch_row(result)){
					if(row[0]!=NULL){
							std::string SA=ctos.tele;
							std::string SB=row[0];
							if(SA==SB){
								stoc.cmd=loginsuccess;
							}
						}
					}
					memcpy(snd_buf,&stoc,sizeof stoc);
					send(fd,&snd_buf,sizeof snd_buf,0);
				}
				if(ctos.cmd==user_query){
					std::string S1 ="select * from parking_lot_info;";
					mysql_query(m_sql,const_cast<char *>(S1.c_str()));
					MYSQL_RES *result;
					MYSQL_ROW row;
					result = mysql_store_result(m_sql);
					while((row = mysql_fetch_row(result))){
        					memset(&stoc,0,sizeof stoc);
        					stoc.cmd=QUERYBACK;
        					if(row[0]!=NULL)//parkid
        						memcpy(stoc.carid,row[0], strlen(row[0]) );
        					if(row[1]!=NULL)//tele
        						memcpy(stoc.tele,row[1],strlen(row[1]));
        					if(row[2]!=NULL)//allnum
        						memcpy(stoc.ordertime,row[2],strlen(row[2]));
        					if(row[3]!=NULL)//nownum
        						memcpy(stoc.intime,row[3],strlen(row[3]));
        					if(row[4]!=NULL)//addr
        						memcpy(stoc.outtime,row[4],strlen(row[4]));
        					memset(snd_buf,0,sizeof snd_buf);
        					memcpy(snd_buf,&stoc,sizeof snd_buf);
						send(fd,&snd_buf,sizeof snd_buf,0);	
        				}
				}
			}
        		mysql_close(m_sql);

		}
		else {
			pthread_mutex_unlock(&pthis->clientlist_mutex);
			sleep(0.1);
		}
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq (%rdi), %rax
leaq 0xc0(%rax), %rcx
movq %rcx, -0x150(%rbp)
leaq 0x28(%rax), %rcx
movq %rcx, -0x148(%rbp)
leaq 0x98(%rax), %rcx
movq %rcx, -0x1a8(%rbp)
movq %rax, -0x158(%rbp)
addq $0x40, %rax
movq %rax, -0x1a0(%rbp)
leaq -0x13c(%rbp), %r14
leaq -0x2b0(%rbp), %r12
movq -0x158(%rbp), %rax
cmpb $0x1, 0x118(%rax)
jne 0x37b7
movq -0x150(%rbp), %rbx
movq %rbx, %rdi
callq 0x2320
movq -0x148(%rbp), %rax
cmpq %rax, (%rax)
je 0x37a3
xorl %edi, %edi
callq 0x2110
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq %rax, %rdi
leaq 0x2612(%rip), %rsi      # 0x507f
leaq 0x2615(%rip), %rdx      # 0x5089
leaq 0x2613(%rip), %rcx      # 0x508e
leaq 0x2614(%rip), %r8       # 0x5096
xorl %r9d, %r9d
callq 0x2150
movq %rax, -0x38(%rbp)
testq %rax, %rax
jne 0x2a9f
leaq 0x2771(%rip), %rdi      # 0x520b
callq 0x2350
xorps %xmm0, %xmm0
movaps %xmm0, -0x240(%rbp)
movaps %xmm0, -0x250(%rbp)
movaps %xmm0, -0x2b0(%rbp)
movaps %xmm0, -0x2a0(%rbp)
movaps %xmm0, -0x290(%rbp)
movaps %xmm0, -0x280(%rbp)
andq $0x0, -0x260(%rbp)
movaps %xmm0, -0x270(%rbp)
movq -0x148(%rbp), %rdi
movq (%rdi), %rax
movl 0x10(%rax), %eax
movl %eax, -0x2c(%rbp)
callq 0x3a84
movq -0x150(%rbp), %rdi
callq 0x21e0
movl -0x2c(%rbp), %edi
leaq -0x250(%rbp), %rsi
pushq $0x20
popq %rdx
xorl %ecx, %ecx
callq 0x20b0
testl %eax, %eax
js 0x3795
movaps -0x250(%rbp), %xmm0
movaps -0x240(%rbp), %xmm1
movaps %xmm1, -0x70(%rbp)
movaps %xmm0, -0x80(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x100(%rbp)
movaps %xmm0, -0x110(%rbp)
movaps %xmm0, -0x120(%rbp)
andq $0x0, -0xf0(%rbp)
movaps %xmm0, -0x130(%rbp)
movaps %xmm0, -0x140(%rbp)
movl -0x80(%rbp), %eax
testl %eax, %eax
jne 0x2bca
movq -0x1a8(%rbp), %rbx
movq %rbx, %rdi
callq 0x2320
movq -0x1a0(%rbp), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x4018
movq %rbx, %rdi
callq 0x21e0
andl $0x0, -0x50(%rbp)
movl -0x2c(%rbp), %edx
movl %edx, -0x54(%rbp)
movl $0x1, -0x58(%rbp)
movq -0x158(%rbp), %rax
movl 0x1c(%rax), %edi
pushq $0x2
popq %rsi
leaq -0x58(%rbp), %rcx
callq 0x2310
movl -0x2c(%rbp), %edi
callq 0x2400
leaq 0x24de(%rip), %rdi      # 0x509e
xorl %eax, %eax
callq 0x2040
movl -0x80(%rbp), %eax
cmpl $0x1, %eax
jne 0x2e6d
leaq -0x58(%rbp), %rdi
leaq 0x24c9(%rip), %rsi      # 0x50a7
leaq -0xa0(%rbp), %rbx
movq %rbx, %rdx
callq 0x3a92
movl -0x7c(%rbp), %esi
movq %rbx, %rdi
callq 0x3acd
leaq -0xc0(%rbp), %rdi
leaq -0x78(%rbp), %rsi
leaq -0xe0(%rbp), %rbx
movq %rbx, %rdx
callq 0x3a92
movq %rbx, %rdi
leaq -0x6c(%rbp), %rsi
leaq -0x178(%rbp), %rdx
callq 0x3a92
leaq -0x1e8(%rbp), %rbx
movq %rbx, %rdi
leaq -0x58(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x3b7f
leaq -0x208(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
leaq 0x2461(%rip), %rdx      # 0x50b4
callq 0x3b2d
leaq -0x228(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
leaq -0xc0(%rbp), %rdx
callq 0x3b56
leaq -0x198(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
leaq 0x242e(%rip), %rdx      # 0x50b3
callq 0x3b2d
leaq -0x1c8(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
leaq -0xe0(%rbp), %rdx
callq 0x3b56
leaq -0x178(%rbp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
leaq 0x2400(%rip), %rdx      # 0x50b7
callq 0x3b2d
leaq -0x58(%rbp), %rdi
movq %rbx, %rsi
callq 0x22d0
movq %rbx, %rdi
callq 0x2100
movq %r13, %rdi
callq 0x2100
leaq -0x198(%rbp), %rdi
callq 0x2100
leaq -0x228(%rbp), %rdi
callq 0x2100
leaq -0x208(%rbp), %rdi
callq 0x2100
leaq -0x1e8(%rbp), %rdi
callq 0x2100
movq -0x58(%rbp), %rsi
movq -0x38(%rbp), %rdi
callq 0x21a0
testl %eax, %eax
je 0x2e14
leaq -0x58(%rbp), %rdi
leaq 0x2393(%rip), %rsi      # 0x50bb
callq 0x23e0
movl -0x7c(%rbp), %esi
leaq -0x178(%rbp), %r15
movq %r15, %rdi
callq 0x3acd
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x23f0
movq %r15, %rdi
callq 0x2100
movq %rbx, %rdi
leaq 0x2354(%rip), %rsi      # 0x50b4
callq 0x23d0
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x23d0
leaq -0x58(%rbp), %rdi
leaq 0x233a(%rip), %rsi      # 0x50b7
callq 0x23d0
movq -0x38(%rbp), %rdi
callq 0x22f0
xorl %edi, %edi
callq 0x2110
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq %rax, %rdi
leaq 0x22dc(%rip), %rsi      # 0x507f
leaq 0x22df(%rip), %rdx      # 0x5089
leaq 0x22dd(%rip), %rcx      # 0x508e
leaq 0x22de(%rip), %r8       # 0x5096
xorl %r9d, %r9d
callq 0x2150
movq -0x58(%rbp), %rsi
movq %rax, %rdi
callq 0x21a0
xorl %ecx, %ecx
testl %eax, %eax
jne 0x2ded
movq -0x58(%rbp), %rsi
movq 0x51fb(%rip), %rdi      # 0x7fd8
callq 0x2230
movq %rax, %rdi
callq 0x2130
pushq $0x1
popq %rcx
movl %ecx, -0x140(%rbp)
pushq $0x16
popq %rcx
movq %r12, %rdi
leaq -0x140(%rbp), %rsi
rep  movsl (%rsi), %es:(%rdi)
movl -0x2c(%rbp), %edi
movq %r12, %rsi
pushq $0x58
popq %rdx
xorl %ecx, %ecx
callq 0x2140
jmp 0x2e3d
movl $0x1, -0x140(%rbp)
pushq $0x16
popq %rcx
movq %r12, %rdi
leaq -0x140(%rbp), %rsi
rep  movsl (%rsi), %es:(%rdi)
movl -0x2c(%rbp), %edi
movq %r12, %rsi
pushq $0x58
popq %rdx
xorl %ecx, %ecx
callq 0x2140
leaq -0xe0(%rbp), %rdi
callq 0x2100
leaq -0xc0(%rbp), %rdi
callq 0x2100
leaq -0xa0(%rbp), %rdi
callq 0x2100
leaq -0x58(%rbp), %rdi
callq 0x2100
movl -0x80(%rbp), %eax
cmpl $0x2, %eax
jne 0x3045
leaq -0x58(%rbp), %rdi
leaq 0x224c(%rip), %rsi      # 0x50cd
leaq -0xa0(%rbp), %rbx
movq %rbx, %rdx
callq 0x3a92
movl -0x7c(%rbp), %esi
movq %rbx, %rdi
callq 0x3acd
leaq -0xc0(%rbp), %rdi
leaq -0x78(%rbp), %rsi
leaq -0xe0(%rbp), %rdx
callq 0x3a92
leaq -0x198(%rbp), %rbx
movq %rbx, %rdi
leaq -0x58(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x3b7f
leaq -0x1c8(%rbp), %r13
movq %r13, %rdi
movq %rbx, %rsi
leaq 0x21d4(%rip), %rdx      # 0x50b4
callq 0x3b2d
leaq -0x178(%rbp), %r15
movq %r15, %rdi
movq %r13, %rsi
leaq -0xc0(%rbp), %rdx
callq 0x3b56
leaq -0xe0(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
leaq 0x21a5(%rip), %rdx      # 0x50b7
callq 0x3b2d
leaq -0x58(%rbp), %rdi
movq %rbx, %rsi
callq 0x22d0
movq %rbx, %rdi
callq 0x2100
movq %r15, %rdi
callq 0x2100
leaq -0x1c8(%rbp), %rdi
callq 0x2100
leaq -0x198(%rbp), %rdi
callq 0x2100
movl $0x3, -0x140(%rbp)
movq -0x58(%rbp), %rsi
movq -0x38(%rbp), %rdi
callq 0x21a0
testl %eax, %eax
je 0x2f7a
pushq $0x16
popq %rcx
movq %r12, %rdi
leaq -0x140(%rbp), %rsi
rep  movsl (%rsi), %es:(%rdi)
jmp 0x3011
movq -0x38(%rbp), %rdi
callq 0x2160
movq %rax, %rbx
testq %rax, %rax
je 0x3011
movq %rbx, %rdi
callq 0x2280
testq %rax, %rax
je 0x3009
movl $0x2, -0x140(%rbp)
leaq -0x78(%rbp), %rdx
movl 0x8(%rdx), %ecx
movl %ecx, 0x8(%r14)
movq (%rdx), %rcx
movq %rcx, (%r14)
movq (%rax), %rcx
testq %rcx, %rcx
je 0x2fcc
movups (%rcx), %xmm0
leaq -0xfc(%rbp), %rcx
movups %xmm0, (%rcx)
movq 0x8(%rax), %rcx
testq %rcx, %rcx
je 0x2fe2
movups (%rcx), %xmm0
leaq -0x124(%rbp), %rcx
movups %xmm0, (%rcx)
movq 0x10(%rax), %rax
testq %rax, %rax
je 0x2ff8
movups (%rax), %xmm0
leaq -0x110(%rbp), %rax
movups %xmm0, (%rax)
pushq $0x16
popq %rcx
movq %r12, %rdi
leaq -0x140(%rbp), %rsi
rep  movsl (%rsi), %es:(%rdi)
jmp 0x2f8f
movq %rbx, %rdi
callq 0x2260
movl -0x2c(%rbp), %edi
movq %r12, %rsi
pushq $0x58
popq %rdx
xorl %ecx, %ecx
callq 0x2140
leaq -0xc0(%rbp), %rdi
callq 0x2100
leaq -0xa0(%rbp), %rdi
callq 0x2100
leaq -0x58(%rbp), %rdi
callq 0x2100
movl -0x80(%rbp), %eax
cmpl $0x3, %eax
jne 0x31f1
leaq -0x58(%rbp), %rdi
leaq 0x2081(%rip), %rsi      # 0x50da
leaq -0xa0(%rbp), %rbx
movq %rbx, %rdx
callq 0x3a92
movl -0x7c(%rbp), %esi
movq %rbx, %rdi
callq 0x3acd
leaq -0xc0(%rbp), %rdi
leaq -0x78(%rbp), %rsi
leaq -0xe0(%rbp), %rbx
movq %rbx, %rdx
callq 0x3a92
movq %rbx, %rdi
leaq -0x6c(%rbp), %rsi
leaq -0x178(%rbp), %rdx
callq 0x3a92
leaq -0x1e8(%rbp), %rbx
movq %rbx, %rdi
leaq -0x58(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x3b7f
leaq -0x208(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
leaq 0x1fe6(%rip), %rdx      # 0x50b4
callq 0x3b2d
leaq -0x228(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
leaq -0xc0(%rbp), %rdx
callq 0x3b56
leaq -0x198(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
leaq 0x1fb3(%rip), %rdx      # 0x50b3
callq 0x3b2d
leaq -0x1c8(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
leaq -0xe0(%rbp), %rdx
callq 0x3b56
leaq -0x178(%rbp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
leaq 0x1f85(%rip), %rdx      # 0x50b7
callq 0x3b2d
leaq -0x58(%rbp), %rdi
movq %rbx, %rsi
callq 0x22d0
movq %rbx, %rdi
callq 0x2100
movq %r13, %rdi
callq 0x2100
leaq -0x198(%rbp), %rdi
callq 0x2100
leaq -0x228(%rbp), %rdi
callq 0x2100
leaq -0x208(%rbp), %rdi
callq 0x2100
leaq -0x1e8(%rbp), %rdi
callq 0x2100
movq -0x58(%rbp), %rsi
movq -0x38(%rbp), %rdi
callq 0x21a0
cmpl $0x1, %eax
pushq $0x5
popq %rax
sbbl $0x0, %eax
movl %eax, -0x140(%rbp)
pushq $0x16
popq %rcx
movq %r12, %rdi
leaq -0x140(%rbp), %rax
movq %rax, %rsi
rep  movsl (%rsi), %es:(%rdi)
movl -0x2c(%rbp), %edi
movq %rax, %rsi
pushq $0x58
popq %rdx
xorl %ecx, %ecx
callq 0x2140
leaq -0xe0(%rbp), %rdi
callq 0x2100
leaq -0xc0(%rbp), %rdi
callq 0x2100
leaq -0xa0(%rbp), %rdi
callq 0x2100
leaq -0x58(%rbp), %rdi
callq 0x2100
movl -0x80(%rbp), %eax
cmpl $0x4, %eax
jne 0x32ea
leaq -0x58(%rbp), %rdi
leaq 0x1ee2(%rip), %rsi      # 0x50e7
leaq -0xa0(%rbp), %rbx
movq %rbx, %rdx
callq 0x3a92
movl -0x7c(%rbp), %esi
movq %rbx, %rdi
callq 0x3acd
leaq -0xc0(%rbp), %rdi
leaq 0x1e8b(%rip), %rsi      # 0x50b8
leaq -0xe0(%rbp), %rdx
callq 0x3a92
leaq -0x178(%rbp), %r15
movq %r15, %rdi
leaq -0x58(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x3b7f
leaq -0xe0(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
leaq -0xc0(%rbp), %rdx
callq 0x3b56
leaq -0x58(%rbp), %rdi
movq %rbx, %rsi
callq 0x22d0
movq %rbx, %rdi
callq 0x2100
movq %r15, %rdi
callq 0x2100
movq -0x58(%rbp), %rsi
movq -0x38(%rbp), %rdi
callq 0x21a0
cmpl $0x1, %eax
pushq $0x7
popq %rax
sbbl $0x0, %eax
movl %eax, -0x140(%rbp)
pushq $0x16
popq %rcx
movq %r12, %rdi
leaq -0x140(%rbp), %rax
movq %rax, %rsi
rep  movsl (%rsi), %es:(%rdi)
movl -0x2c(%rbp), %edi
movq %rax, %rsi
pushq $0x58
popq %rdx
xorl %ecx, %ecx
callq 0x2140
leaq -0xc0(%rbp), %rdi
callq 0x2100
leaq -0xa0(%rbp), %rdi
callq 0x2100
leaq -0x58(%rbp), %rdi
callq 0x2100
movl -0x80(%rbp), %eax
cmpl $0x5, %eax
jne 0x34d1
leaq -0x58(%rbp), %rdi
leaq 0x1df5(%rip), %rsi      # 0x50f3
leaq -0xa0(%rbp), %rbx
movq %rbx, %rdx
callq 0x3a92
movl -0x7c(%rbp), %esi
movq %rbx, %rdi
callq 0x3acd
leaq -0xe0(%rbp), %r15
movq %r15, %rdi
leaq -0x58(%rbp), %rsi
movq %rbx, %rdx
callq 0x3b7f
leaq -0xc0(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
leaq 0x1dcc(%rip), %rdx      # 0x510e
callq 0x3b2d
leaq -0x58(%rbp), %rdi
movq %rbx, %rsi
callq 0x22d0
movq %rbx, %rdi
callq 0x2100
movq %r15, %rdi
callq 0x2100
movq -0x58(%rbp), %rsi
movq -0x38(%rbp), %rdi
callq 0x21a0
testl %eax, %eax
je 0x3393
movl $0x9, -0x140(%rbp)
movl -0x2c(%rbp), %edi
movq %r12, %rsi
pushq $0x58
popq %rdx
xorl %ecx, %ecx
callq 0x2140
jmp 0x34b9
movq -0x38(%rbp), %rdi
callq 0x2160
movq %rax, %rbx
movq %rbx, %rdi
callq 0x2280
testq %rax, %rax
je 0x3483
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%r14)
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x10(%r14)
andl $0x0, 0x50(%r14)
movups %xmm0, (%r14)
movl $0xa, -0x140(%rbp)
movq (%rax), %rcx
testq %rcx, %rcx
je 0x33ef
movl 0x8(%rcx), %edx
movl %edx, 0x8(%r14)
movq (%rcx), %rcx
movq %rcx, (%r14)
movq 0x8(%rax), %rcx
testq %rcx, %rcx
je 0x340b
movl 0x8(%rcx), %edx
leaq -0x130(%rbp), %rsi
movl %edx, 0x8(%rsi)
movq (%rcx), %rcx
movq %rcx, (%rsi)
movq 0x10(%rax), %rcx
testq %rcx, %rcx
je 0x3427
movl 0x10(%rcx), %edx
leaq -0xfc(%rbp), %rsi
movl %edx, 0x10(%rsi)
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x18(%rax), %rcx
testq %rcx, %rcx
je 0x3443
movl 0x10(%rcx), %edx
leaq -0x124(%rbp), %rsi
movl %edx, 0x10(%rsi)
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x20(%rax), %rax
testq %rax, %rax
je 0x345f
movl 0x10(%rax), %ecx
leaq -0x110(%rbp), %rdx
movl %ecx, 0x10(%rdx)
movups (%rax), %xmm0
movups %xmm0, (%rdx)
pushq $0x16
popq %rcx
movq %r12, %rdi
leaq -0x140(%rbp), %rsi
rep  movsl (%rsi), %es:(%rdi)
movl -0x2c(%rbp), %edi
movq %r12, %rsi
pushq $0x58
popq %rdx
xorl %ecx, %ecx
callq 0x2140
jmp 0x339f
testq %rbx, %rbx
je 0x3490
movq %rbx, %rdi
callq 0x2260
movl $0xb, -0x140(%rbp)
pushq $0x16
popq %rcx
movq %r12, %rdi
leaq -0x140(%rbp), %rsi
rep  movsl (%rsi), %es:(%rdi)
movl -0x2c(%rbp), %edi
movq %r12, %rsi
pushq $0x58
popq %rdx
xorl %ecx, %ecx
callq 0x2140
leaq -0xa0(%rbp), %rdi
callq 0x2100
leaq -0x58(%rbp), %rdi
callq 0x2100
movl -0x80(%rbp), %eax
cmpl $0xd, %eax
jne 0x353e
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
leaq 0x1c2d(%rip), %rsi      # 0x5111
leaq -0xa0(%rbp), %rdx
callq 0x3a92
movq %rbx, %rdi
leaq -0x78(%rbp), %rsi
callq 0x23d0
movq %rbx, %rdi
leaq 0x1bad(%rip), %rsi      # 0x50b3
callq 0x23d0
movq %rbx, %rdi
leaq -0x6c(%rbp), %rsi
callq 0x23d0
movq %rbx, %rdi
leaq 0x1b96(%rip), %rsi      # 0x50b7
callq 0x23d0
movq -0x58(%rbp), %rsi
movq -0x38(%rbp), %rdi
callq 0x21a0
movq %rbx, %rdi
callq 0x2100
movl -0x80(%rbp), %eax
cmpl $0xc, %eax
jne 0x363f
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
leaq 0x1bee(%rip), %rsi      # 0x5143
leaq -0xa0(%rbp), %rdx
callq 0x3a92
movq %rbx, %rdi
leaq -0x78(%rbp), %rsi
callq 0x23d0
leaq -0x58(%rbp), %rdi
leaq 0x1bfa(%rip), %rsi      # 0x5172
callq 0x23d0
movq -0x58(%rbp), %rsi
movq -0x38(%rbp), %rdi
callq 0x21a0
movq -0x38(%rbp), %rdi
callq 0x2160
movl $0xf, -0x140(%rbp)
movq %rax, %rdi
callq 0x2280
movq %rax, %rbx
testq %rax, %rax
je 0x3614
cmpq $0x0, (%rbx)
je 0x3614
leaq -0xa0(%rbp), %rdi
leaq -0x6c(%rbp), %rsi
leaq -0xc0(%rbp), %r15
movq %r15, %rdx
callq 0x3a92
movq (%rbx), %rsi
movq %r15, %rdi
leaq -0xe0(%rbp), %rdx
callq 0x3a92
leaq -0xa0(%rbp), %rdi
movq %r15, %rsi
callq 0x3bb7
testb %al, %al
je 0x35fc
movl $0xe, -0x140(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x2100
leaq -0xa0(%rbp), %rdi
callq 0x2100
pushq $0x16
popq %rcx
movq %r12, %rdi
leaq -0x140(%rbp), %rsi
rep  movsl (%rsi), %es:(%rdi)
movl -0x2c(%rbp), %edi
movq %r12, %rsi
pushq $0x58
popq %rdx
xorl %ecx, %ecx
callq 0x2140
leaq -0x58(%rbp), %rdi
callq 0x2100
movl -0x80(%rbp), %eax
cmpl $0x6, %eax
jne 0x2afc
leaq -0x58(%rbp), %rdi
leaq 0x1b22(%rip), %rsi      # 0x5175
leaq -0xa0(%rbp), %rdx
callq 0x3a92
movq -0x58(%rbp), %rsi
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
callq 0x21a0
movq %rbx, %rdi
callq 0x2160
movq %rax, %rbx
movq %rbx, %rdi
callq 0x2280
movq %rax, %r13
testq %rax, %rax
je 0x3787
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%r14)
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x10(%r14)
andl $0x0, 0x50(%r14)
movups %xmm0, (%r14)
movl $0xa, -0x140(%rbp)
movq (%r13), %r15
testq %r15, %r15
je 0x36d7
movq %r15, %rdi
callq 0x20e0
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x2200
movq 0x8(%r13), %r15
testq %r15, %r15
je 0x36fa
movq %r15, %rdi
callq 0x20e0
leaq -0x130(%rbp), %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x2200
movq 0x10(%r13), %r15
testq %r15, %r15
je 0x371d
movq %r15, %rdi
callq 0x20e0
leaq -0xfc(%rbp), %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x2200
movq 0x18(%r13), %r15
testq %r15, %r15
je 0x3740
movq %r15, %rdi
callq 0x20e0
leaq -0x124(%rbp), %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x2200
movq 0x20(%r13), %r15
testq %r15, %r15
je 0x3763
movq %r15, %rdi
callq 0x20e0
leaq -0x110(%rbp), %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x2200
pushq $0x16
popq %rcx
movq %r12, %rdi
leaq -0x140(%rbp), %rsi
rep  movsl (%rsi), %es:(%rdi)
movl -0x2c(%rbp), %edi
movq %r12, %rsi
pushq $0x58
popq %rdx
xorl %ecx, %ecx
callq 0x2140
jmp 0x367a
leaq -0x58(%rbp), %rdi
callq 0x2100
jmp 0x2afc
movq -0x38(%rbp), %rdi
callq 0x22f0
jmp 0x2a22
movq %rbx, %rdi
callq 0x21e0
xorl %edi, %edi
callq 0x21d0
jmp 0x2a22
xorl %eax, %eax
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3956
jmp 0x3945
jmp 0x3934
movq %rax, %rbx
leaq -0x178(%rbp), %rdi
jmp 0x3908
jmp 0x3921
jmp 0x3921
jmp 0x3945
jmp 0x3878
jmp 0x3956
jmp 0x3878
jmp 0x3878
jmp 0x3956
jmp 0x3878
jmp 0x3956
jmp 0x3878
jmp 0x3878
jmp 0x3945
movq %rax, %rbx
leaq -0x178(%rbp), %rdi
jmp 0x392b
jmp 0x3956
jmp 0x3934
jmp 0x38e6
movq %rax, %rbx
jmp 0x38dd
jmp 0x3891
jmp 0x3956
jmp 0x3945
jmp 0x3934
jmp 0x38ae
jmp 0x3956
jmp 0x3878
jmp 0x3921
jmp 0x388c
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
jmp 0x393e
jmp 0x3934
jmp 0x3956
movq %rax, %rbx
jmp 0x3962
jmp 0x38b3
jmp 0x3945
jmp 0x3934
movq %rax, %rbx
jmp 0x38a0
movq %rax, %rbx
leaq -0x1c8(%rbp), %rdi
callq 0x2100
leaq -0x198(%rbp), %rdi
callq 0x2100
jmp 0x38e9
movq %rax, %rbx
jmp 0x38f5
movq %rax, %rbx
jmp 0x3901
movq %rax, %rbx
jmp 0x38d1
jmp 0x3945
movq %rax, %rbx
leaq -0x178(%rbp), %rdi
callq 0x2100
leaq -0x1c8(%rbp), %rdi
callq 0x2100
leaq -0x198(%rbp), %rdi
jmp 0x392b
movq %rax, %rbx
leaq -0x228(%rbp), %rdi
callq 0x2100
leaq -0x208(%rbp), %rdi
callq 0x2100
leaq -0x1e8(%rbp), %rdi
callq 0x2100
jmp 0x3924
jmp 0x3945
jmp 0x3921
jmp 0x3945
jmp 0x3934
jmp 0x3921
jmp 0x3934
jmp 0x3921
jmp 0x3956
jmp 0x3956
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x2100
jmp 0x3937
jmp 0x3956
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x2100
jmp 0x3948
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x2100
jmp 0x3959
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x2380