// File: /workspace/github_c_makefile_star2_O0/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
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
leaq 0x94f37(%rip), %rax     # 0xa11a4
movq %rax, -0x20(%rbp)
leaq 0x94f4e(%rip), %rax     # 0xa11c6
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
leaq -0x70(%rbp), %rdi
xorl %esi, %esi
movl $0x32, %edx
callq 0xb2b0
movl $0x0, -0xdc(%rbp)
leaq 0x94f4d(%rip), %rdi     # 0xa11fa
callq 0xb1c0
cmpl $0x2, -0x14(%rbp)
je 0xc2bd
jmp 0xc4cf
movq -0x20(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
xorl %edx, %edx
callq 0xb8d0
cmpl $0x0, %eax
jne 0xc2eb
movq -0x28(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
xorl %edx, %edx
callq 0xb8d0
cmpl $0x0, %eax
je 0xc2fc
leaq 0x94f11(%rip), %rdi     # 0xa1203
callq 0xb160
jmp 0xc4cf
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
movl $0x1, %edx
leaq -0xd8(%rbp), %rcx
xorl %r8d, %r8d
callq 0xb8a0
cmpl $0x11, %eax
jne 0xc346
leaq -0x70(%rbp), %rdi
leaq 0x99989(%rip), %rsi     # 0xa5cbc
leaq 0x94ed2(%rip), %rdx     # 0xa120c
movb $0x0, %al
callq 0xb7a0
jmp 0xc42f
movl -0xd8(%rbp), %ecx
movq -0x30(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl -0xd4(%rbp), %eax
subl -0xd8(%rbp), %eax
movl %eax, -0xdc(%rbp)
movq -0x30(%rbp), %rax
movslq -0xdc(%rbp), %rcx
movb $0x0, -0x1(%rax,%rcx)
movq -0x30(%rbp), %rax
movslq -0xdc(%rbp), %rcx
addq %rcx, %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x22, %ecx
movb %al, -0xdd(%rbp)
je 0xc3b7
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
seta %al
movb %al, -0xdd(%rbp)
movb -0xdd(%rbp), %al
testb $0x1, %al
jne 0xc3c3
jmp 0xc3d1
movq -0x38(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xc392
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jne 0xc3f6
leaq -0x70(%rbp), %rdi
leaq 0x998d6(%rip), %rsi     # 0xa5cbc
leaq 0x94e1f(%rip), %rdx     # 0xa120c
movb $0x0, %al
callq 0xb7a0
jmp 0xc418
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
leaq -0x70(%rbp), %rdi
movq -0x38(%rbp), %rdx
leaq 0x998ab(%rip), %rsi     # 0xa5cbc
movb $0x0, %al
callq 0xb7a0
movl -0xdc(%rbp), %ecx
addl $0x1, %ecx
movq -0x30(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
jmp 0xc431
movq -0x30(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
movl $0x1, %edx
leaq -0xd8(%rbp), %rcx
xorl %r8d, %r8d
callq 0xb8a0
cmpl $0x11, %eax
jne 0xc457
jmp 0xc4b7
movl -0xd4(%rbp), %eax
subl -0xd8(%rbp), %eax
movl %eax, -0xdc(%rbp)
movq -0x30(%rbp), %rax
movslq -0xd8(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movslq -0xdc(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0xb280
movl -0xdc(%rbp), %ecx
addl $0x1, %ecx
movq -0x30(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
jmp 0xc431
leaq -0xa0(%rbp), %rdi
callq 0xb3e0
leaq -0xd0(%rbp), %rdi
callq 0xb3e0
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax,%rax)