// File: /workspace/github_c_makefile_star2_O3/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 0x6c5a6(%rip), %rdi     # 0x771fa
callq 0xa150
cmpl $0x2, %r15d
jne 0xac9d
leaq 0x6c53e(%rip), %rsi     # 0x771a4
leaq -0xa0(%rbp), %rdi
xorl %edx, %edx
callq 0xa5d0
testl %eax, %eax
jne 0xac91
leaq 0x6c547(%rip), %rsi     # 0x771c6
leaq -0xd0(%rbp), %rdi
xorl %edx, %edx
callq 0xa5d0
testl %eax, %eax
je 0xacaf
leaq 0x6c56b(%rip), %rdi     # 0x77203
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 0xa5b0
cmpl $0x11, %eax
jne 0xacde
movw $0x72, -0x6c(%rbp)
movl $0x6568746f, -0x70(%rbp) # imm = 0x6568746F
jmp 0xad3a
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 0xad13
cmpb $0x22, (%rcx)
movq %rsi, %rcx
jne 0xacff
testq %rax, %rax
je 0xad27
addq $0x2, %rsi
leaq -0x70(%rbp), %rdi
callq 0xa0d0
jmp 0xad34
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 0xa5b0
cmpl $0x11, %eax
je 0xadac
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 0xa5b0
movq %r14, %r12
cmpl $0x11, %eax
jne 0xad65
leaq -0xa0(%rbp), %rdi
callq 0xa2f0
leaq -0xd0(%rbp), %rdi
callq 0xa2f0
jmp 0xac9d
nopl (%rax)