// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/output.c
// Function: output
void output( char *host , char *body , int type)
{
	char *regexstr = "<tr\\s+logr=[\\d\\D]*?>[\\d\\D]*?</tr>";//get house info
	char *cityreg = "locallist\\\":\\[\\{\\\"dispid\\\":\\\"\\d*\\\",\\\"name\\\":\\\".*?\\\"";//get city
	char *temp = NULL;//temp var
	char *ctmp = NULL;// city temp var
	char cityName[50] ={ 0 };//city name
	regex_t reg;//get house info reg
	regex_t cityr;//get city info reg
	regmatch_t pmatch;//reg return value
	int len = 0;
	
	initDB("house.db");

	if ( type != 2 )
	{
		return;
	}
//	pthread_mutex_lock(&outlock);
	if (regcomp(&reg,regexstr,0)!=0 || regcomp(&cityr,cityreg,0)!=0 )
	{
		puts("comp err");
//		pthread_mutex_unlock(&outlock);
		return;
	}
	temp = body;
	if ( regexec(&cityr,temp,1,&pmatch,0) == REG_NOMATCH )
	{
		//	puts("No City");
		sprintf(cityName,"%s","other");
	}
	else
	{
		temp+=pmatch.rm_so;
		len = pmatch.rm_eo-pmatch.rm_so;
		*(temp+len-1)=0;
		ctmp = temp+len-1;
		while( *ctmp !='\"'&& ctmp > temp )
		{
			ctmp--;
		}
		if ( ctmp == temp )
		{
			sprintf(cityName,"%s","other");
		}
		else
		{
			ctmp++;
			sprintf(cityName,"%s",ctmp);
		}
		//		save(cityName);
		temp+=len+1;
	}

	//	puts(cityName);

	for(;;)
	{
		if (regexec(&reg, temp ,1,&pmatch,0 ) == REG_NOMATCH)
		{
			//			puts("no match");
			break;
		}
		else
		{
			//			puts("match");
			len = pmatch.rm_eo - pmatch.rm_so;
			temp = temp + pmatch.rm_so;
			*(temp+len) = 0;
			save(host, cityName, temp);
			temp+=len+1;
			//	printf("%d\n",len);
		}
	}
	regfree(&reg);
	regfree(&cityr);
//	pthread_mutex_unlock(&outlock);
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movaps %xmm0, -0x60(%rbp)
movaps %xmm0, -0x70(%rbp)
movw $0x0, -0x40(%rbp)
leaq 0x6e5b6(%rip), %rdi     # 0x791fa
callq 0xa150
cmpl $0x2, %r15d
jne 0xac8d
leaq 0x6e54e(%rip), %rsi     # 0x791a4
leaq -0xa0(%rbp), %rdi
xorl %edx, %edx
callq 0xa5c0
testl %eax, %eax
jne 0xac81
leaq 0x6e557(%rip), %rsi     # 0x791c6
leaq -0xd0(%rbp), %rdi
xorl %edx, %edx
callq 0xa5c0
testl %eax, %eax
je 0xac9f
leaq 0x6e57b(%rip), %rdi     # 0x79203
callq 0xa110
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0xd0(%rbp), %rdi
leaq -0x30(%rbp), %rcx
movl $0x1, %edx
movq %r12, %rsi
xorl %r8d, %r8d
callq 0xa5a0
cmpl $0x11, %eax
jne 0xacce
movw $0x72, -0x6c(%rbp)
movl $0x6568746f, -0x70(%rbp) # imm = 0x6568746F
jmp 0xad2a
movslq -0x30(%rbp), %rax
addq %rax, %r12
movslq -0x2c(%rbp), %rdx
movq %rdx, %rcx
subq %rax, %rcx
leaq (%r12,%rcx), %r14
addq %r12, %rcx
decq %rcx
movb $0x0, (%rcx)
subq %rdx, %rax
leaq -0x1(%rcx), %rsi
incq %rax
cmpq %r12, %rcx
jbe 0xad03
cmpb $0x22, (%rcx)
movq %rsi, %rcx
jne 0xacef
testq %rax, %rax
je 0xad17
addq $0x2, %rsi
leaq -0x70(%rbp), %rdi
callq 0xa0d0
jmp 0xad24
movw $0x72, -0x6c(%rbp)
movl $0x6568746f, -0x70(%rbp) # imm = 0x6568746F
incq %r14
movq %r14, %r12
leaq -0xa0(%rbp), %rdi
leaq -0x30(%rbp), %rcx
movl $0x1, %edx
movq %r12, %rsi
xorl %r8d, %r8d
callq 0xa5a0
cmpl $0x11, %eax
je 0xad9c
leaq -0xa0(%rbp), %r15
leaq -0x30(%rbp), %r13
movslq -0x2c(%rbp), %rax
movslq -0x30(%rbp), %rcx
subq %rcx, %rax
addq %rcx, %r12
leaq (%rax,%r12), %r14
incq %r14
movb $0x0, -0x1(%r14)
movq %rbx, %rdi
leaq -0x70(%rbp), %rsi
movq %r12, %rdx
callq 0xa1f0
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rcx
xorl %r8d, %r8d
callq 0xa5a0
movq %r14, %r12
cmpl $0x11, %eax
jne 0xad55
leaq -0xa0(%rbp), %rdi
callq 0xa2e0
leaq -0xd0(%rbp), %rdi
callq 0xa2e0
jmp 0xac8d
nopl (%rax)