// File: /workspace/github_c_makefile_star2_O0/shifengbin[P]bishe/Output/output.c
// Function: save
void save(char *host,char *cityName ,  char  *body)
{


	regex_t reg;
	regex_t titlereg;
	regex_t xiaoqureg;
	regex_t pricereg;
	regex_t showroomreg;

	regmatch_t pmatch;
	char *href = "href=\\\"http.*?\\\"";//get info url reg
	char *title = "<a.*?onclick.*?>.*?</a>";
	char *xiaoqu = "<a href.*?class=\\\"a_xq1\\\">.*?</a>";
	char *price = "<b\\sclass=\'pri\'>.*?</b>";
	char *showroom="<span\\sclass=\\\"showroom\\\">.*?</span>";

	char ref[1024] = { 0 };
	char t_title[512] = { 0 };
	char t_xiaoqu[255] = { 0 };
	char t_price[16] = { 0 };
	char t_showroom[32] = { 0 };

	char *temp = body;
	char *ti;

	int len = 0;
	if ( body == NULL || strlen(body) == 0 )
	{
		return;
	}

	if ( regcomp(&reg , href , 0) !=0 || regcomp( &titlereg , title , 0)!=0||regcomp(&xiaoqureg, xiaoqu ,0) != 0 || regcomp( &pricereg ,price,0)!= 0||regcomp(&showroomreg,showroom,0) != 0)
	{
		return;
	}
	// get info url
	if ( regexec( &reg , body , 1, &pmatch,0) == REG_NOMATCH )
	{
		return;
	}

	len = pmatch.rm_eo - pmatch.rm_so;
	temp+=pmatch.rm_so;
	*(temp+len-1) = 0;	
	sprintf(ref , "%s",temp+6);
	temp+=len;
	// get title
	if ( regexec( &titlereg,temp,1,&pmatch, 0 ) == REG_NOMATCH )
	{
		return;
	}
	len = pmatch.rm_eo - pmatch.rm_so;
	temp+=pmatch.rm_so;
	if ( (ti = strstr(temp , ">")) == NULL)
	{
		return;
	}
	ti++;
	*(temp+len-4) = 0;	
	sprintf(t_title , "%s",ti);
	temp+=len;
	// get xiaoqu	
	if ( regexec( &xiaoqureg,temp,1,&pmatch, 0 ) == REG_NOMATCH )
	{
		return;
	}
	len = pmatch.rm_eo - pmatch.rm_so;
	temp+=pmatch.rm_so;
	if ( (ti = strstr(temp , ">")) == NULL)
	{
		return;
	}
	ti++;
	*(temp+len-4) = 0;	
	sprintf(t_xiaoqu , "%s",ti);
	temp+=len;
	//get price
	if ( regexec( &pricereg,temp,1,&pmatch, 0 ) == REG_NOMATCH )
	{
		return;
	}
	len = pmatch.rm_eo - pmatch.rm_so;
	temp+=pmatch.rm_so;
	if ( (ti = strstr(temp , ">")) == NULL)
	{
		return;
	}
	ti++;
	*(temp+len-4) = 0;	
	sprintf(t_price , "%s",ti);
	temp+=len;
	//get showroom
	if ( regexec( &showroomreg,temp,1,&pmatch, 0 ) == REG_NOMATCH )
	{
		return;
	}
	len = pmatch.rm_eo - pmatch.rm_so;
	temp+=pmatch.rm_so;
	if ( (ti = strstr(temp , ">")) == NULL)
	{
		return;
	}
	ti++;
	*(temp+len-7) = 0;	
	sprintf(t_showroom , "%s",ti);
	temp+=len;
	///////////////////////
	puts(host);
	puts(cityName);
	puts(ref);	
	puts(t_title);
	puts(t_xiaoqu);
	puts(t_price);
	puts(t_showroom);
	saveToDB(t_title,cityName,t_xiaoqu,t_showroom,t_price,ref,host);
	//////////////////////
	regfree(&reg);
	regfree(&titlereg);
	regfree(&xiaoqureg);
	regfree(&pricereg);
	regfree(&showroomreg);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x890, %rsp            # imm = 0x890
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq 0x954de(%rip), %rax     # 0xa111c
movq %rax, -0x118(%rbp)
leaq 0x954e1(%rip), %rax     # 0xa112d
movq %rax, -0x120(%rbp)
leaq 0x954eb(%rip), %rax     # 0xa1145
movq %rax, -0x128(%rbp)
leaq 0x954ff(%rip), %rax     # 0xa1167
movq %rax, -0x130(%rbp)
leaq 0x95509(%rip), %rax     # 0xa117f
movq %rax, -0x138(%rbp)
leaq -0x540(%rbp), %rdi
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0xb2b0
leaq -0x740(%rbp), %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0xb2b0
leaq -0x840(%rbp), %rdi
xorl %esi, %esi
movl $0xff, %edx
callq 0xb2b0
leaq -0x850(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xb2b0
leaq -0x870(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0xb2b0
movq -0x18(%rbp), %rax
movq %rax, -0x878(%rbp)
movl $0x0, -0x884(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xbd07
movq -0x18(%rbp), %rdi
callq 0xb210
cmpq $0x0, %rax
jne 0xbd0c
jmp 0xc241
movq -0x118(%rbp), %rsi
leaq -0x48(%rbp), %rdi
xorl %edx, %edx
callq 0xb8d0
cmpl $0x0, %eax
jne 0xbd88
movq -0x120(%rbp), %rsi
leaq -0x78(%rbp), %rdi
xorl %edx, %edx
callq 0xb8d0
cmpl $0x0, %eax
jne 0xbd88
movq -0x128(%rbp), %rsi
leaq -0xa8(%rbp), %rdi
xorl %edx, %edx
callq 0xb8d0
cmpl $0x0, %eax
jne 0xbd88
movq -0x130(%rbp), %rsi
leaq -0xd8(%rbp), %rdi
xorl %edx, %edx
callq 0xb8d0
cmpl $0x0, %eax
jne 0xbd88
movq -0x138(%rbp), %rsi
leaq -0x108(%rbp), %rdi
xorl %edx, %edx
callq 0xb8d0
cmpl $0x0, %eax
je 0xbd8d
jmp 0xc241
movq -0x18(%rbp), %rsi
leaq -0x48(%rbp), %rdi
movl $0x1, %edx
leaq -0x110(%rbp), %rcx
xorl %r8d, %r8d
callq 0xb8a0
cmpl $0x11, %eax
jne 0xbdb3
jmp 0xc241
movl -0x10c(%rbp), %eax
subl -0x110(%rbp), %eax
movl %eax, -0x884(%rbp)
movl -0x110(%rbp), %ecx
movq -0x878(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x878(%rbp)
movq -0x878(%rbp), %rax
movslq -0x884(%rbp), %rcx
movb $0x0, -0x1(%rax,%rcx)
leaq -0x540(%rbp), %rdi
movq -0x878(%rbp), %rdx
addq $0x6, %rdx
leaq 0x99eb1(%rip), %rsi     # 0xa5cbc
movb $0x0, %al
callq 0xb7a0
movl -0x884(%rbp), %ecx
movq -0x878(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x878(%rbp)
movq -0x878(%rbp), %rsi
leaq -0x78(%rbp), %rdi
movl $0x1, %edx
leaq -0x110(%rbp), %rcx
xorl %r8d, %r8d
callq 0xb8a0
cmpl $0x11, %eax
jne 0xbe55
jmp 0xc241
movl -0x10c(%rbp), %eax
subl -0x110(%rbp), %eax
movl %eax, -0x884(%rbp)
movl -0x110(%rbp), %ecx
movq -0x878(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x878(%rbp)
movq -0x878(%rbp), %rdi
leaq 0x952d6(%rip), %rsi     # 0xa1165
callq 0xb920
movq %rax, -0x880(%rbp)
cmpq $0x0, %rax
jne 0xbea6
jmp 0xc241
movq -0x880(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x880(%rbp)
movq -0x878(%rbp), %rax
movslq -0x884(%rbp), %rcx
movb $0x0, -0x4(%rax,%rcx)
leaq -0x740(%rbp), %rdi
movq -0x880(%rbp), %rdx
leaq 0x99ddc(%rip), %rsi     # 0xa5cbc
movb $0x0, %al
callq 0xb7a0
movl -0x884(%rbp), %ecx
movq -0x878(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x878(%rbp)
movq -0x878(%rbp), %rsi
leaq -0xa8(%rbp), %rdi
movl $0x1, %edx
leaq -0x110(%rbp), %rcx
xorl %r8d, %r8d
callq 0xb8a0
cmpl $0x11, %eax
jne 0xbf2d
jmp 0xc241
movl -0x10c(%rbp), %eax
subl -0x110(%rbp), %eax
movl %eax, -0x884(%rbp)
movl -0x110(%rbp), %ecx
movq -0x878(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x878(%rbp)
movq -0x878(%rbp), %rdi
leaq 0x951fe(%rip), %rsi     # 0xa1165
callq 0xb920
movq %rax, -0x880(%rbp)
cmpq $0x0, %rax
jne 0xbf7e
jmp 0xc241
movq -0x880(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x880(%rbp)
movq -0x878(%rbp), %rax
movslq -0x884(%rbp), %rcx
movb $0x0, -0x4(%rax,%rcx)
leaq -0x840(%rbp), %rdi
movq -0x880(%rbp), %rdx
leaq 0x99d04(%rip), %rsi     # 0xa5cbc
movb $0x0, %al
callq 0xb7a0
movl -0x884(%rbp), %ecx
movq -0x878(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x878(%rbp)
movq -0x878(%rbp), %rsi
leaq -0xd8(%rbp), %rdi
movl $0x1, %edx
leaq -0x110(%rbp), %rcx
xorl %r8d, %r8d
callq 0xb8a0
cmpl $0x11, %eax
jne 0xc005
jmp 0xc241
movl -0x10c(%rbp), %eax
subl -0x110(%rbp), %eax
movl %eax, -0x884(%rbp)
movl -0x110(%rbp), %ecx
movq -0x878(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x878(%rbp)
movq -0x878(%rbp), %rdi
leaq 0x95126(%rip), %rsi     # 0xa1165
callq 0xb920
movq %rax, -0x880(%rbp)
cmpq $0x0, %rax
jne 0xc056
jmp 0xc241
movq -0x880(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x880(%rbp)
movq -0x878(%rbp), %rax
movslq -0x884(%rbp), %rcx
movb $0x0, -0x4(%rax,%rcx)
leaq -0x850(%rbp), %rdi
movq -0x880(%rbp), %rdx
leaq 0x99c2c(%rip), %rsi     # 0xa5cbc
movb $0x0, %al
callq 0xb7a0
movl -0x884(%rbp), %ecx
movq -0x878(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x878(%rbp)
movq -0x878(%rbp), %rsi
leaq -0x108(%rbp), %rdi
movl $0x1, %edx
leaq -0x110(%rbp), %rcx
xorl %r8d, %r8d
callq 0xb8a0
cmpl $0x11, %eax
jne 0xc0dd
jmp 0xc241
movl -0x10c(%rbp), %eax
subl -0x110(%rbp), %eax
movl %eax, -0x884(%rbp)
movl -0x110(%rbp), %ecx
movq -0x878(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x878(%rbp)
movq -0x878(%rbp), %rdi
leaq 0x9504e(%rip), %rsi     # 0xa1165
callq 0xb920
movq %rax, -0x880(%rbp)
cmpq $0x0, %rax
jne 0xc12e
jmp 0xc241
movq -0x880(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x880(%rbp)
movq -0x878(%rbp), %rax
movslq -0x884(%rbp), %rcx
movb $0x0, -0x7(%rax,%rcx)
leaq -0x870(%rbp), %rdi
movq -0x880(%rbp), %rdx
leaq 0x99b54(%rip), %rsi     # 0xa5cbc
movb $0x0, %al
callq 0xb7a0
movl -0x884(%rbp), %ecx
movq -0x878(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x878(%rbp)
movq -0x8(%rbp), %rdi
callq 0xb160
movq -0x10(%rbp), %rdi
callq 0xb160
leaq -0x540(%rbp), %rdi
callq 0xb160
leaq -0x740(%rbp), %rdi
callq 0xb160
leaq -0x840(%rbp), %rdi
callq 0xb160
leaq -0x850(%rbp), %rdi
callq 0xb160
leaq -0x870(%rbp), %rdi
callq 0xb160
leaq -0x740(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x840(%rbp), %rdx
leaq -0x870(%rbp), %rcx
leaq -0x850(%rbp), %r8
leaq -0x540(%rbp), %r9
movq -0x8(%rbp), %rax
movq %rax, (%rsp)
callq 0xb320
leaq -0x48(%rbp), %rdi
callq 0xb3e0
leaq -0x78(%rbp), %rdi
callq 0xb3e0
leaq -0xa8(%rbp), %rdi
callq 0xb3e0
leaq -0xd8(%rbp), %rdi
callq 0xb3e0
leaq -0x108(%rbp), %rdi
callq 0xb3e0
addq $0x890, %rsp            # imm = 0x890
popq %rbp
retq
nopw (%rax,%rax)