LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/event/qq_event_timer.h
// Function: qq_event_add_timer
static inline void
qq_event_add_timer(qq_event_t *ev, qq_msec_t timer)
{
    qq_msec_t      key;
    qq_msec_int_t  diff;

    key = qq_current_msec + timer;

    if (ev->timer_set) {
        diff = (qq_msec_int_t) (key - ev->timer.key);
        if (qq_abs(diff) < QQ_TIMER_LAZY_DELAY) {
            return;
        }

        qq_event_del_timer(ev);
    }

    ev->timer.key = key;
    qq_rbtree_insert(&qq_event_timer_rbtree, &ev->timer);
    ev->timer_set = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0xa9a0(%rip), %rax      # 0xe6c0
movl $0xbb8, %r14d           # imm = 0xBB8
addq (%rax), %r14
testb $0x8, 0x9(%rdi)
je 0x3d5d
movq %r14, %rax
subq 0x20(%rbx), %rax
movq %rax, %rcx
negq %rcx
cmovsq %rax, %rcx
cmpq $0x12c, %rcx            # imm = 0x12C
jb 0x3d75
leaq 0x20(%rbx), %rsi
leaq 0xa5bc(%rip), %rdi      # 0xe310
callq 0x7ad8
andb $-0x9, 0x9(%rbx)
leaq 0x20(%rbx), %rsi
movq %r14, 0x20(%rbx)
leaq 0xa5a4(%rip), %rdi      # 0xe310
callq 0x78b8
orb $0x8, 0x9(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/app/qq_ios_app.c
// Function: qq_ios_app_process_request_handler
static void
qq_ios_app_process_request_handler(qq_event_t *rev)
{
    qq_connection_t   *c;
    ssize_t            n;
    size_t             size;

    c = rev->data;

    if (c->buffer->last - c->buffer->pos > 0) {
        qq_ios_app_process_package(c);
        c->buffer->last = c->buffer->pos;
        return;
    }

    n = c->recv(c, (u_char *)c->buffer->pos,
        (size_t)((uintptr_t)c->buffer->end - (uintptr_t)c->buffer->start));
    if (n == QQ_AGAIN) {
        if (qq_handle_read_event(rev) != QQ_OK) {
            qq_app_close_connection(c);
        }
        return;
    }

    if (n == QQ_ERROR) {
        qq_app_close_connection(c);
        return;
    }

    if (n == 0) {
        qq_log_error(0, "client closed connection");
        qq_app_close_connection(c);
        return;
    }

    c->buffer->last += n;
    qq_ios_app_process_package(c);
    c->buffer->last = c->buffer->pos;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq (%rdi), %rbx
movq 0x20(%rbx), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rcx
subq %rsi, %rcx
testq %rcx, %rcx
jle 0x3da0
movq %rsi, 0x8(%rax)
popq %rbx
popq %r14
popq %rbp
retq
movq %rdi, %r14
movq 0x28(%rax), %rdx
subq 0x20(%rax), %rdx
movq %rbx, %rdi
callq *0x28(%rbx)
testq %rax, %rax
je 0x3dd1
cmpq $-0x1, %rax
je 0x3de1
cmpq $-0x2, %rax
jne 0x3ded
movq %r14, %rdi
callq 0x3359
testq %rax, %rax
jne 0x3de1
jmp 0x3d9b
leaq 0x5a50(%rip), %rsi      # 0x9828
xorl %edi, %edi
xorl %eax, %eax
callq 0x65bd
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x26aa
movq 0x20(%rbx), %rax
movq (%rax), %rcx
movq %rcx, 0x8(%rax)
jmp 0x3d9b
nop
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_json.c
// Function: qq_cjson_init
int qq_cjson_init(size_t size)
{
    void *p;

    p = memalign(16, size);
    if (p == NULL) {
        return -1;
    }

    qq_cjson_buf = (qq_cjson_buf_t *) p;
    qq_cjson_buf->start = (u_char *) p + sizeof(qq_cjson_buf_t);
    qq_cjson_buf->pos = qq_cjson_buf->start;
    qq_cjson_buf->end = (u_char *) p + size;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x10
popq %rdi
movq %rbx, %rsi
callq 0x22c0
testq %rax, %rax
je 0x3e32
movq %rax, 0xa50c(%rip)      # 0xe328
leaq 0x18(%rax), %rcx
movq %rcx, (%rax)
movq %rcx, 0x8(%rax)
addq %rax, %rbx
movq %rbx, 0x10(%rax)
xorl %eax, %eax
jmp 0x3e35
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_json.c
// Function: cJSON_InitHooks
void cJSON_InitHooks(cJSON_Hooks* hooks)
{
    if (!hooks) { /* Reset hooks */
        cJSON_malloc = malloc;
        cJSON_free = free;
        return;
    }

	cJSON_malloc = (hooks->malloc_fn)?hooks->malloc_fn:malloc;
	cJSON_free	 = (hooks->free_fn)?hooks->free_fn:free;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x3e84
movq (%rdi), %rcx
movq 0x8(%rdi), %rax
testq %rcx, %rcx
jne 0x3e76
movq 0xa16a(%rip), %rcx      # 0xdfe0
testq %rax, %rax
jne 0x3e92
movq 0xa156(%rip), %rax      # 0xdfd8
jmp 0x3e92
movq 0xa14d(%rip), %rax      # 0xdfd8
movq 0xa14e(%rip), %rcx      # 0xdfe0
movq %rcx, 0xa31f(%rip)      # 0xe1b8
movq %rax, 0xa320(%rip)      # 0xe1c0
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_json.c
// Function: cJSON_Delete
void cJSON_Delete(cJSON *c)
{
	cJSON *next;
	while (c)
	{
		next=c->next;
		if (!(c->type&cJSON_IsReference) && c->child) cJSON_Delete(c->child);
		if (!(c->type&cJSON_IsReference) && c->valuestring) cJSON_free(c->valuestring);
		if (!(c->type&cJSON_StringIsConst) && c->string) cJSON_free(c->string);
		cJSON_free(c);
		c=next;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
testq %rbx, %rbx
je 0x3f09
movq (%rbx), %r14
movl 0x18(%rbx), %eax
btl $0x8, %eax
jb 0x3ece
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x3ece
callq 0x3ea2
movl 0x18(%rbx), %eax
btl $0x8, %eax
jb 0x3ee6
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x3ee6
callq *0xa2dd(%rip)           # 0xe1c0
movl 0x18(%rbx), %eax
btl $0x9, %eax
jb 0x3efb
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x3efb
callq *0xa2c5(%rip)           # 0xe1c0
movq %rbx, %rdi
callq *0xa2bc(%rip)           # 0xe1c0
movq %r14, %rbx
jmp 0x3eac
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_json.c
// Function: cJSON_ParseWithOpts
cJSON *cJSON_ParseWithOpts(const char *value,const char **return_parse_end,int require_null_terminated)
{
	const char *end=0;
	cJSON *c=cJSON_New_Item();
	ep=0;
	if (!c) return 0;       /* memory fail */

	end=parse_value(c,skip(value));
	if (!end)	{cJSON_Delete(c);return 0;}	/* parse failure. ep is set. */

	/* if we require null-terminated JSON without appended garbage, skip and then check for a null terminator */
	if (require_null_terminated) {end=skip(end);if (*end) {cJSON_Delete(c);ep=end;return 0;}}
	if (return_parse_end) *return_parse_end=end;
	return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %r12
pushq $0x40
popq %rdi
callq *0xa28d(%rip)           # 0xe1b8
testq %rax, %rax
je 0x3f8e
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
andq $0x0, 0xa3e3(%rip)      # 0xe330
movq %r12, %rdi
callq 0x447d
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3fb8
testq %rax, %rax
je 0x3fa2
movq %rax, %r12
testl %r15d, %r15d
je 0x3f98
movq %r12, %rdi
callq 0x447d
movq %rax, %r12
cmpb $0x0, (%rax)
je 0x3f98
movq %rbx, %rdi
callq 0x3ea2
movq %r12, 0xa3a4(%rip)      # 0xe330
jmp 0x3faa
andq $0x0, 0xa39a(%rip)      # 0xe330
jmp 0x3faa
testq %r14, %r14
je 0x3fac
movq %r12, (%r14)
jmp 0x3fac
movq %rbx, %rdi
callq 0x3ea2
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_json.c
// Function: print_value
static char *print_value(cJSON *item,int depth,int fmt,printbuffer *p)
{
	char *out=0;
	if (!item) return 0;
	if (p)
	{
		switch ((item->type)&255)
		{
			case cJSON_NULL:	{out=ensure(p,5);	if (out) strcpy(out,"null");	break;}
			case cJSON_False:	{out=ensure(p,6);	if (out) strcpy(out,"false");	break;}
			case cJSON_True:	{out=ensure(p,5);	if (out) strcpy(out,"true");	break;}
			case cJSON_Number:	out=print_number(item,p);break;
			case cJSON_String:	out=print_string(item,p);break;
			case cJSON_Array:	out=print_array(item,depth,fmt,p);break;
			case cJSON_Object:	out=print_object(item,depth,fmt,p);break;
		}
	}
	else
	{
		switch ((item->type)&255)
		{
			case cJSON_NULL:	out=cJSON_strdup("null");	break;
			case cJSON_False:	out=cJSON_strdup("false");break;
			case cJSON_True:	out=cJSON_strdup("true"); break;
			case cJSON_Number:	out=print_number(item,0);break;
			case cJSON_String:	out=print_string(item,0);break;
			case cJSON_Array:	out=print_array(item,depth,fmt,0);break;
			case cJSON_Object:	out=print_object(item,depth,fmt,0);break;
		}
	}
	return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x455f
movb 0x18(%rdi), %al
testq %rcx, %rcx
je 0x4507
cmpb $0x6, %al
ja 0x455f
movzbl %al, %eax
leaq 0x53f0(%rip), %r8       # 0x98d0
movslq (%r8,%rax,4), %rax
addq %r8, %rax
jmpq *%rax
pushq $0x6
popq %rsi
movq %rcx, %rdi
callq 0x5298
testq %rax, %rax
je 0x455f
movw $0x65, 0x4(%rax)
movl $0x736c6166, (%rax)     # imm = 0x736C6166
jmp 0x4561
cmpb $0x6, %al
ja 0x455f
movzbl %al, %eax
leaq 0x53d7(%rip), %rcx      # 0x98ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x5451(%rip), %rdi      # 0x9976
jmp 0x458d
pushq $0x5
popq %rsi
movq %rcx, %rdi
callq 0x5298
testq %rax, %rax
je 0x455f
movb $0x0, 0x4(%rax)
movl $0x6c6c756e, (%rax)     # imm = 0x6C6C756E
jmp 0x4561
pushq $0x5
popq %rsi
movq %rcx, %rdi
callq 0x5298
testq %rax, %rax
je 0x455f
movb $0x0, 0x4(%rax)
movl $0x65757274, (%rax)     # imm = 0x65757274
jmp 0x4561
xorl %eax, %eax
popq %rbp
retq
movq %rcx, %rsi
jmp 0x4580
movq %rcx, %rsi
jmp 0x456f
xorl %esi, %esi
popq %rbp
jmp 0x54c5
leaq 0x53f5(%rip), %rdi      # 0x9971
jmp 0x458d
xorl %esi, %esi
popq %rbp
jmp 0x5341
leaq 0x53ef(%rip), %rdi      # 0x997c
popq %rbp
jmp 0x473b
xorl %ecx, %ecx
popq %rbp
jmp 0x54d3
xorl %ecx, %ecx
popq %rbp
jmp 0x5794
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_json.c
// Function: cJSON_PrintBuffered
char *cJSON_PrintBuffered(cJSON *item,int prebuffer,int fmt)
{
	printbuffer p;
	p.buffer=(char*)cJSON_malloc(prebuffer);
	p.length=prebuffer;
	p.offset=0;
	return print_value(item,0,fmt,&p);
	return p.buffer;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movq %rdi, %r14
movslq %esi, %r15
movq %r15, %rdi
callq *0x9be7(%rip)           # 0xe1b8
leaq -0x28(%rbp), %rcx
movq %rax, (%rcx)
movl %r15d, 0x8(%rcx)
andl $0x0, 0xc(%rcx)
movq %r14, %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x44b9
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_json.c
// Function: cJSON_Duplicate
cJSON *cJSON_Duplicate(cJSON *item,int recurse)
{
	cJSON *newitem,*cptr,*nptr=0,*newchild;
	/* Bail on bad ptr */
	if (!item) return 0;
	/* Create new item */
	newitem=cJSON_New_Item();
	if (!newitem) return 0;
	/* Copy over all vars */
	newitem->type=item->type&(~cJSON_IsReference),newitem->valueint=item->valueint,newitem->valuedouble=item->valuedouble;
	if (item->valuestring)	{newitem->valuestring=cJSON_strdup(item->valuestring);	if (!newitem->valuestring)	{cJSON_Delete(newitem);return 0;}}
	if (item->string)		{newitem->string=cJSON_strdup(item->string);			if (!newitem->string)		{cJSON_Delete(newitem);return 0;}}
	/* If non-recursive, then we're done! */
	if (!recurse) return newitem;
	/* Walk the ->next chain for the child. */
	cptr=item->child;
	while (cptr)
	{
		newchild=cJSON_Duplicate(cptr,1);		/* Duplicate (with recurse) each item in the ->next chain */
		if (!newchild) {cJSON_Delete(newitem);return 0;}
		if (nptr)	{nptr->next=newchild,newchild->prev=nptr;nptr=newchild;}	/* If newitem->child already set, then crosswire ->prev and ->next and move on */
		else		{newitem->child=newchild;nptr=newchild;}					/* Set newitem->child and move to it */
		cptr=cptr->next;
	}
	return newitem;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x4e65
movl %esi, %r15d
movq %rdi, %r14
pushq $0x40
popq %rdi
callq *0x9408(%rip)           # 0xe1b8
testq %rax, %rax
je 0x4e65
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movl $0xfffffeff, %eax       # imm = 0xFFFFFEFF
andl 0x18(%r14), %eax
movl %eax, 0x18(%rbx)
movl 0x28(%r14), %eax
movl %eax, 0x28(%rbx)
movsd 0x30(%r14), %xmm0
movsd %xmm0, 0x30(%rbx)
movq 0x20(%r14), %rdi
testq %rdi, %rdi
je 0x4e03
callq 0x473b
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x4e5d
movq 0x38(%r14), %rdi
testq %rdi, %rdi
je 0x4e1a
callq 0x473b
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0x4e5d
testl %r15d, %r15d
je 0x4e67
addq $0x10, %r14
xorl %r12d, %r12d
pushq $0x1
popq %r15
movq (%r14), %r14
testq %r14, %r14
je 0x4e67
movq %r14, %rdi
movl %r15d, %esi
callq 0x4d8d
testq %rax, %rax
je 0x4e5d
testq %r12, %r12
je 0x4e54
movq %rax, (%r12)
movq %r12, 0x8(%rax)
movq %rax, %r12
jmp 0x4e2a
movq %rax, 0x10(%rbx)
movq %rax, %r12
jmp 0x4e2a
movq %rbx, %rdi
callq 0x3ea2
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_json.c
// Function: cJSON_Minify
void cJSON_Minify(char *json)
{
	char *into=json;
	while (*json)
	{
		if (*json==' ') json++;
		else if (*json=='\t') json++;	/* Whitespace characters. */
		else if (*json=='\r') json++;
		else if (*json=='\n') json++;
		else if (*json=='/' && json[1]=='/')  while (*json && *json!='\n') json++;	/* double-slash comments, to end of line. */
		else if (*json=='/' && json[1]=='*') {while (*json && !(*json=='*' && json[1]=='/')) json++;json+=2;}	/* multiline comments. */
		else if (*json=='\"'){*into++=*json++;while (*json && *json!='\"'){if (*json=='\\') *into++=*json++;*into++=*json++;}*into++=*json++;} /* string literals, which are \" sensitive. */
		else *into++=*json++;			/* All other characters. */
	}
	*into=0;	/* and null-terminate. */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
movzbl (%rdi), %ecx
cmpl $0x9, %ecx
je 0x4ea8
cmpl $0xa, %ecx
je 0x4ea8
cmpl $0xd, %ecx
je 0x4ea8
cmpl $0x20, %ecx
je 0x4ea8
cmpl $0x22, %ecx
je 0x4ead
cmpl $0x2f, %ecx
je 0x4eea
testl %ecx, %ecx
jne 0x4f3f
jmp 0x4f4c
incq %rdi
jmp 0x4e7a
movb $0x22, (%rax)
movzbl 0x1(%rdi), %ecx
cmpl $0x5c, %ecx
je 0x4eca
testl %ecx, %ecx
je 0x4edd
cmpl $0x22, %ecx
je 0x4edd
incq %rax
incq %rdi
jmp 0x4ed9
movb $0x5c, 0x1(%rax)
addq $0x2, %rax
movb 0x2(%rdi), %cl
addq $0x2, %rdi
movb %cl, (%rax)
jmp 0x4eb0
addq $0x2, %rdi
movb %cl, 0x1(%rax)
addq $0x2, %rax
jmp 0x4e7a
movzbl 0x1(%rdi), %edx
cmpl $0x2f, %edx
je 0x4f2a
cmpl $0x2a, %edx
jne 0x4f3f
addq $0x2, %rdi
movb $0x2f, %cl
cmpb $0x2a, %cl
je 0x4f13
movzbl %cl, %ecx
testl %ecx, %ecx
je 0x4e7a
movb -0x1(%rdi), %cl
jmp 0x4f1f
movb -0x1(%rdi), %cl
cmpb $0x2f, %cl
je 0x4e7a
incq %rdi
jmp 0x4efe
movb 0x1(%rdi), %dl
incq %rdi
testb %dl, %dl
je 0x4e7a
movzbl %dl, %ecx
cmpl $0xa, %ecx
jne 0x4f24
jmp 0x4e7a
incq %rdi
movb %cl, (%rax)
incq %rax
jmp 0x4e7a
movb $0x0, (%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_json.c
// Function: qq_cjson_malloc
static void *qq_cjson_malloc(size_t size)
{
    u_char  *m;

    qq_log_debug("qq_cjson_malloc(size: %d)", size);

    m = qq_cjson_buf->pos;
    m = qq_cjson_align_ptr(m, QQ_CJSON_ALIGNMENT);

    if ((size_t)(qq_cjson_buf->end - m) >= size) {
        qq_cjson_buf->pos = m + size;
        return m;
    }

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x49e5(%rip), %rdi      # 0x9947
xorl %r14d, %r14d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6706
movq 0x93b2(%rip), %rax      # 0xe328
movq 0x8(%rax), %rcx
movq 0x10(%rax), %rdx
addq $0x7, %rcx
andq $-0x8, %rcx
subq %rcx, %rdx
cmpq %rbx, %rdx
jb 0x4f98
addq %rcx, %rbx
movq %rbx, 0x8(%rax)
movq %rcx, %r14
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_json.c
// Function: parse_hex4
static unsigned parse_hex4(const char *str)
{
	unsigned h=0;
	if (*str>='0' && *str<='9') h+=(*str)-'0'; else if (*str>='A' && *str<='F') h+=10+(*str)-'A'; else if (*str>='a' && *str<='f') h+=10+(*str)-'a'; else return 0;
	h=h<<4;str++;
	if (*str>='0' && *str<='9') h+=(*str)-'0'; else if (*str>='A' && *str<='F') h+=10+(*str)-'A'; else if (*str>='a' && *str<='f') h+=10+(*str)-'a'; else return 0;
	h=h<<4;str++;
	if (*str>='0' && *str<='9') h+=(*str)-'0'; else if (*str>='A' && *str<='F') h+=10+(*str)-'A'; else if (*str>='a' && *str<='f') h+=10+(*str)-'a'; else return 0;
	h=h<<4;str++;
	if (*str>='0' && *str<='9') h+=(*str)-'0'; else if (*str>='A' && *str<='F') h+=10+(*str)-'A'; else if (*str>='a' && *str<='f') h+=10+(*str)-'a'; else return 0;
	return h;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb (%rdi), %cl
leal -0x30(%rcx), %eax
cmpb $0xa, %al
jb 0x51fe
leal -0x41(%rcx), %eax
cmpb $0x5, %al
ja 0x51ee
addb $-0x37, %cl
jmp 0x51fc
leal -0x61(%rcx), %eax
cmpb $0x5, %al
ja 0x5294
addb $-0x57, %cl
movl %ecx, %eax
movb 0x1(%rdi), %dl
leal -0x30(%rdx), %ecx
cmpb $0xa, %cl
jb 0x5223
leal -0x41(%rdx), %ecx
cmpb $0x5, %cl
ja 0x5216
addb $-0x37, %dl
jmp 0x5221
leal -0x61(%rdx), %ecx
cmpb $0x5, %cl
ja 0x5294
addb $-0x57, %dl
movl %edx, %ecx
movb 0x2(%rdi), %sil
leal -0x30(%rsi), %edx
cmpb $0xa, %dl
jb 0x524b
leal -0x41(%rsi), %edx
cmpb $0x5, %dl
ja 0x523d
addb $-0x37, %sil
jmp 0x5249
leal -0x61(%rsi), %edx
cmpb $0x5, %dl
ja 0x5294
addb $-0x57, %sil
movl %esi, %edx
movb 0x3(%rdi), %sil
leal -0x30(%rsi), %edi
cmpb $0xa, %dil
jb 0x5276
leal -0x41(%rsi), %edi
cmpb $0x5, %dil
ja 0x5267
addb $-0x37, %sil
jmp 0x5274
leal -0x61(%rsi), %edi
cmpb $0x5, %dil
ja 0x5294
addb $-0x57, %sil
movl %esi, %edi
movzbl %al, %eax
movzbl %cl, %ecx
shll $0x8, %eax
shll $0x4, %ecx
addl %eax, %ecx
movzbl %dl, %edx
addl %ecx, %edx
shll $0x4, %edx
movzbl %dil, %eax
addl %edx, %eax
jmp 0x5296
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_json.c
// Function: ensure
static char* ensure(printbuffer *p,int needed)
{
	char *newbuffer;int newsize;
	if (!p || !p->buffer) return 0;
	needed+=p->offset;
	if (needed<=p->length) return p->buffer+p->offset;

	newsize=pow2gt(needed);
	newbuffer=(char*)cJSON_malloc(newsize);
	if (!newbuffer) {cJSON_free(p->buffer);p->length=0,p->buffer=0;return 0;}
	if (newbuffer) memcpy(newbuffer,p->buffer,p->length);
	cJSON_free(p->buffer);
	p->length=newsize;
	p->buffer=newbuffer;
	return newbuffer+p->offset;
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x531b
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0xc(%rdi), %rcx
addl %ecx, %esi
cmpl 0x8(%rdi), %esi
jle 0x531e
decl %esi
movl %esi, %eax
sarl %eax
orl %esi, %eax
movl %eax, %ecx
sarl $0x2, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x4, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x8, %ecx
orl %eax, %ecx
movl %ecx, %r15d
sarl $0x10, %r15d
orl %ecx, %r15d
incl %r15d
movslq %r15d, %rdi
callq *0x8ecd(%rip)           # 0xe1b8
testq %rax, %rax
je 0x5323
movq %rax, %r14
movq (%rbx), %rsi
movslq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x21c0
movq (%rbx), %rdi
callq *0x8eb5(%rip)           # 0xe1c0
movl %r15d, 0x8(%rbx)
movq %r14, (%rbx)
movslq 0xc(%rbx), %rax
addq %r14, %rax
jmp 0x5336
xorl %eax, %eax
retq
addq %rcx, %rax
jmp 0x5336
movq (%rbx), %rdi
callq *0x8e94(%rip)           # 0xe1c0
andl $0x0, 0x8(%rbx)
andq $0x0, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_json.c
// Function: print_number
static char *print_number(cJSON *item,printbuffer *p)
{
	char *str=0;
	double d=item->valuedouble;
	if (d==0)
	{
		if (p)	str=ensure(p,2);
		else	str=(char*)cJSON_malloc(2);	/* special case for 0. */
		if (str) strcpy(str,"0");
	}
	else if (fabs(((double)item->valueint)-d)<=DBL_EPSILON && d<=INT_MAX && d>=INT_MIN)
	{
		if (p)	str=ensure(p,21);
		else	str=(char*)cJSON_malloc(21);	/* 2^64+1 can be represented in 21 chars. */
		if (str)	sprintf(str,"%d",item->valueint);
	}
	else
	{
		if (p)	str=ensure(p,64);
		else	str=(char*)cJSON_malloc(64);	/* This is a nice tradeoff. */
		if (str)
		{
			if (fabs(floor(d)-d)<=DBL_EPSILON && fabs(d)<1.0e60)sprintf(str,"%.0f",d);
			else if (fabs(d)<1.0e-6 || fabs(d)>1.0e9)			sprintf(str,"%e",d);
			else												sprintf(str,"%f",d);
		}
	}
	return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movsd 0x30(%rdi), %xmm2
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jne 0x5371
jp 0x5371
testq %rsi, %rsi
je 0x53bf
pushq $0x2
popq %rax
movq %rsi, %rdi
movl %eax, %esi
callq 0x5298
jmp 0x53c8
ucomisd 0x44ff(%rip), %xmm2     # 0x9878
jb 0x53de
movsd 0x44fd(%rip), %xmm0     # 0x9880
ucomisd %xmm2, %xmm0
jb 0x53de
movq %rdi, %r14
cvtsi2sdl 0x28(%rdi), %xmm0
subsd %xmm2, %xmm0
andpd 0x4523(%rip), %xmm0     # 0x98c0
movsd 0x44e3(%rip), %xmm1     # 0x9888
ucomisd %xmm0, %xmm1
jb 0x53de
testq %rsi, %rsi
je 0x53f7
pushq $0x15
popq %rax
movq %rsi, %rdi
movl %eax, %esi
callq 0x5298
jmp 0x5400
pushq $0x2
popq %rdi
callq *0x8df0(%rip)           # 0xe1b8
movq %rax, %rbx
testq %rax, %rax
je 0x547f
movw $0x30, (%rbx)
jmp 0x54b9
movapd %xmm2, -0x20(%rbp)
testq %rsi, %rsi
je 0x5422
pushq $0x40
popq %rax
movq %rsi, %rdi
movl %eax, %esi
callq 0x5298
jmp 0x542b
pushq $0x15
popq %rdi
callq *0x8db8(%rip)           # 0xe1b8
movq %rax, %rbx
testq %rax, %rax
je 0x547f
movl 0x28(%r14), %edx
leaq 0x4220(%rip), %rsi      # 0x9633
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2070
jmp 0x54b9
pushq $0x40
popq %rdi
callq *0x8d8d(%rip)           # 0xe1b8
movq %rax, %rbx
testq %rax, %rax
movapd -0x20(%rbp), %xmm0
je 0x547f
callq 0x22e0
movapd -0x20(%rbp), %xmm4
movapd 0x4476(%rip), %xmm2     # 0x98c0
movapd %xmm4, %xmm1
andpd %xmm2, %xmm1
movsd 0x4436(%rip), %xmm3     # 0x9890
ucomisd %xmm1, %xmm3
jbe 0x5483
subsd %xmm4, %xmm0
andpd %xmm2, %xmm0
movsd 0x4418(%rip), %xmm2     # 0x9888
ucomisd %xmm0, %xmm2
jb 0x5483
leaq 0x4504(%rip), %rsi      # 0x9981
jmp 0x54ab
xorl %ebx, %ebx
jmp 0x54b9
movsd 0x440d(%rip), %xmm0     # 0x9898
ucomisd %xmm1, %xmm0
ja 0x54a4
ucomisd 0x4407(%rip), %xmm1     # 0x98a0
ja 0x54a4
leaq 0x44e7(%rip), %rsi      # 0x9989
jmp 0x54ab
leaq 0x44db(%rip), %rsi      # 0x9986
movq %rbx, %rdi
movapd %xmm4, %xmm0
movb $0x1, %al
callq 0x2070
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_listening.c
// Function: qq_add_listening_config
qq_int_t qq_add_listening_config(int type, int port,
    size_t pool_size, qq_connection_handler_pt handler)
{
    size_t                  size;
    qq_listening_config_t  *lcf;

    size = sizeof(qq_listening_config_t);
    lcf = qq_calloc(size);
    if (lcf == NULL) {
        qq_log_error(0, "qq_add_listening_config() malloc(%u) failed", size);
        return QQ_ERROR;
    }
    lcf->type = type;
    lcf->port = port;
    lcf->pool_size = pool_size;
    lcf->handler = handler;

    if (qq_cycle->current_listening_config == NULL) {
        qq_cycle->current_listening_config = lcf;
        qq_cycle->listening_config = lcf;
    }
    else {
        qq_cycle->current_listening_config->next = lcf;
        qq_cycle->current_listening_config = lcf;
    }
    qq_cycle->nlistening += 1;

    return QQ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %r15d
movl %edi, %r12d
pushq $0x20
popq %rdi
callq 0x2483
testq %rax, %rax
je 0x5f63
movl %r12d, 0x8(%rax)
movl %r15d, 0xc(%rax)
movq %r14, 0x10(%rax)
movq %rbx, 0x18(%rax)
leaq 0x8365(%rip), %rdx      # 0xe2b0
movq (%rdx), %rcx
movq 0x50(%rcx), %rsi
testq %rsi, %rsi
je 0x5f7b
movq %rax, (%rsi)
movq (%rdx), %rcx
leaq 0x50(%rcx), %rdx
jmp 0x5f83
leaq 0x3a36(%rip), %rsi      # 0x99a0
pushq $0x20
popq %rdx
xorl %edi, %edi
xorl %eax, %eax
callq 0x65bd
pushq $-0x1
popq %rax
jmp 0x5f8c
movq %rax, 0x50(%rcx)
leaq 0x48(%rcx), %rdx
movq %rax, (%rdx)
incq 0x38(%rcx)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_listening.c
// Function: qq_create_listening
qq_int_t
qq_create_listening(qq_cycle_t *cycle)
{
    size_t                  size;
    int                     i;
    qq_listening_t         *ls;
    qq_listening_config_t  *p, *n;

    size = sizeof(qq_listening_t) * cycle->nlistening;
    cycle->listening = qq_pcalloc(cycle->pool, size);
    if (cycle->listening == NULL) {
        qq_log_error(0, "qq_listening_t malloc(%u) failed", size);
        return QQ_ERROR;
    }

    cycle->current_listening_config = cycle->listening_config;

    ls = cycle->listening;
    for (i = 0; i < cycle->nlistening; i++) {
        ls[i].sockaddr.sin_family = AF_INET;
        ls[i].sockaddr.sin_addr.s_addr = htonl(INADDR_ANY);
        ls[i].sockaddr.sin_port = htons(cycle->current_listening_config->port);
        ls[i].socklen = sizeof(struct sockaddr);

        ls[i].addr_text_len = qq_sock_ntop(&ls[i].sockaddr, ls[i].addr_text);
        qq_log_debug("listening address: %s, address len: %d",
            ls[i].addr_text, ls[i].addr_text_len);

        ls[i].fd = (qq_socket_t) -1;
        ls[i].type = cycle->current_listening_config->type;

        ls[i].backlog = QQ_LISTEN_BACKLOG;
        ls[i].rcvbuf = QQ_SOCK_REVBUF_SIZE;
        ls[i].sndbuf = QQ_SOCK_SNDBUF_SIZE;

        ls[i].handler = cycle->current_listening_config->handler;
        ls[i].pool_size = cycle->current_listening_config->pool_size;

        cycle->current_listening_config = cycle->current_listening_config->next;
    }

    for (p = cycle->listening_config, n = cycle->listening_config->next;
         /* void */;
         p = n, n = n->next) {
        free(p);
        if (n == NULL) {
            break;
        }
    }

    return QQ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
imulq $0x60, 0x38(%rdi), %r15
movq (%rdi), %rdi
movq %r15, %rsi
callq 0x7694
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0x6083
movq %rax, %r14
movq 0x48(%rbx), %rax
movq %rax, 0x50(%rbx)
movabsq $0x2000000001ff, %r13   # imm = 0x2000000001FF
xorl %r15d, %r15d
cmpq %r15, 0x38(%rbx)
jbe 0x606b
movw $0x2, 0x4(%r14)
andl $0x0, 0x8(%r14)
movzwl 0xc(%rax), %eax
rolw $0x8, %ax
leaq 0x4(%r14), %rdi
movw %ax, 0x6(%r14)
movl $0x10, 0x14(%r14)
leaq 0x18(%r14), %r12
movq %r12, %rsi
callq 0x3ae8
movl %eax, 0x30(%r14)
leaq 0x39cc(%rip), %rdi      # 0x99ed
movq %r12, %rsi
movl %eax, %edx
xorl %eax, %eax
callq 0x6706
orl $-0x1, (%r14)
movq 0x50(%rbx), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x34(%r14)
movq %r13, 0x38(%r14)
movl $0x2000, 0x40(%r14)     # imm = 0x2000
movq 0x18(%rax), %rcx
movq %rcx, 0x48(%r14)
movq 0x10(%rax), %rcx
movq %rcx, 0x50(%r14)
movq (%rax), %rax
movq %rax, 0x50(%rbx)
incq %r15
addq $0x60, %r14
jmp 0x5fdb
movq 0x48(%rbx), %rdi
xorl %ebx, %ebx
movq (%rdi), %r14
callq 0x2348
movq %r14, %rdi
testq %r14, %r14
jne 0x6071
jmp 0x6099
leaq 0x3942(%rip), %rsi      # 0x99cc
xorl %edi, %edi
movq %r15, %rdx
xorl %eax, %eax
callq 0x65bd
pushq $-0x1
popq %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_listening.c
// Function: qq_close_listening_sockets
void
qq_close_listening_sockets(qq_cycle_t *cycle)
{
    qq_uint_t         i;
    qq_listening_t   *ls;
    qq_connection_t  *c;

    qq_log_debug("qq_close_listening_sockets()");

    ls = cycle->listening;
    for (i = 0; i < cycle->nlistening; i++) {
        c = ls[i].connection;
        if (c) {
            if (c->read->active) {
                qq_epoll_del_event(c->read, QQ_READ_EVENT);
            }

            if (c->pool != NULL && c->type == SOCK_DGRAM) {
                qq_destroy_pool(c->pool);
            }

            qq_free_connection(c);
            c->fd = (qq_socket_t) -1;
        }

        qq_log_debug("close listening %s #%d ", ls[i].addr_text, ls[i].fd);

        if (close(ls[i].fd) == -1) {
            qq_log_error(errno, "close socket %s failed", ls[i].addr_text);
        }


        ls[i].fd = (qq_socket_t) -1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x378f(%rip), %rdi      # 0x9bab
xorl %eax, %eax
callq 0x6706
movq 0x40(%rbx), %r12
leaq 0x379a(%rip), %r14      # 0x9bc8
xorl %r15d, %r15d
cmpq 0x38(%rbx), %r15
jae 0x64c6
movq 0x58(%r12), %r13
testq %r13, %r13
je 0x6479
movq 0x8(%r13), %rdi
testb $0x8, 0x8(%rdi)
je 0x6457
pushq $0x1
popq %rsi
callq 0x2c57
movq 0x40(%r13), %rdi
testq %rdi, %rdi
je 0x646c
cmpl $0x2, 0x48(%r13)
jne 0x646c
callq 0x2348
movq %r13, %rdi
callq 0x2834
orl $-0x1, 0x18(%r13)
leaq 0x18(%r12), %r13
movl (%r12), %edx
movq %r14, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x6706
movl (%r12), %edi
callq 0x2330
cmpl $-0x1, %eax
jne 0x64b5
callq 0x2030
movl (%rax), %edi
leaq 0x3735(%rip), %rsi      # 0x9be0
movq %r13, %rdx
xorl %eax, %eax
callq 0x65bd
orl $-0x1, (%r12)
incq %r15
addq $0x60, %r12
jmp 0x6431
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_log.c
// Function: qq_log_init
void
qq_log_init(qq_pid_t pid)
{
    char *p, *dir;
    char name[100];

    memset(qq_log.str, 0, QQ_MAX_LOG_STR);

    p = qq_log.str;
    qq_log.time_ptr = p;
    p += qq_log_time_value_len();

    qq_log.pid_ptr = p;
    sprintf(qq_log.pid_ptr, "   %10d   ", pid);
    p += qq_log_pid_value_len();

    qq_log.debug_desc_ptr = p;

    qq_log.errno_ptr = p;
    p += qq_log_errno_value_len();

    qq_log.err_desc_ptr = p;

    qq_log.err_prefix_len = qq_log_err_info_prefix_len();
    qq_log.debug_prefix_len = qq_log_debug_info_prefix_len();

    dir = (char *)get_current_dir_name();
    p = memcpy(name, dir, strlen(dir)) + strlen(dir);
    *p++ = '/';
    memcpy(p, QQ_ERR_LOG_FILE_NAME, strlen(QQ_ERR_LOG_FILE_NAME));

    qq_log.err_fd = qq_open_file(name, QQ_FILE_APPEND,
                                 QQ_FILE_CREATE_OR_OPEN,
                                 QQ_FILE_DEFAULT_ACCESS);
    if (qq_log.err_fd == -1) {
        qq_log.err_fd = STDERR_FILENO;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movl %edi, %ebx
leaq 0x7e4a(%rip), %r14      # 0xe338
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x2160
movq %r14, 0x7f34(%rip)      # 0xe438
leaq 0x7e40(%rip), %rdi      # 0xe34b
movq %rdi, 0x7f2e(%rip)      # 0xe440
leaq 0x36de(%rip), %rsi      # 0x9bf7
movl %ebx, %edx
xorl %eax, %eax
callq 0x2070
leaq 0x7e32(%rip), %rax      # 0xe35b
movq %rax, 0x7f28(%rip)      # 0xe458
movq %rax, 0x7f11(%rip)      # 0xe448
leaq 0x7e2a(%rip), %rax      # 0xe368
movq %rax, 0x7f0b(%rip)      # 0xe450
movabsq $0x2300000030, %rax     # imm = 0x2300000030
movq %rax, 0x7f0a(%rip)      # 0xe460
callq 0x2310
movq %rax, %rbx
movq %rax, %rdi
callq 0x20d0
movq %rax, %r14
leaq -0x80(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x21c0
movb $0x2f, -0x80(%rbp,%r14)
movw $0x6f6c, -0x7f(%rbp,%r14) # imm = 0x6F6C
movb $0x67, -0x7d(%rbp,%r14)
movq %r15, %rdi
movl $0x441, %esi            # imm = 0x441
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x21a0
cmpl $-0x1, %eax
pushq $0x2
popq %rcx
cmovnel %eax, %ecx
movl %ecx, 0x7eb6(%rip)      # 0xe468
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_log.c
// Function: qq_log_error_debug_core
static void
qq_log_error_debug_core(int type, qq_err_t err, const char *fmt, va_list args)
{
    int  len;

    memcpy(qq_log.time_ptr, qq_cached_err_log_time.data, qq_cached_err_log_time.len);

    if (type == QQ_LOG_ERROR) {
        sprintf(qq_log.errno_ptr, "%10d   ", err);
        len = vsprintf(qq_log.err_desc_ptr, fmt, args);
        len += qq_log.err_prefix_len;
        qq_log.str[len++] = '\n';
        write(qq_log.err_fd, qq_log.str, len);
    }
    else if (type == QQ_LOG_DEBUG){
        len = vsprintf(qq_log.debug_desc_ptr, fmt, args);
        len += qq_log.debug_prefix_len;
        qq_log.str[len++] = '\n';
        write(STDERR_FILENO, qq_log.str, len);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %r15d
movl %edi, %r12d
movq 0x7ddb(%rip), %rdi      # 0xe438
leaq 0x804c(%rip), %rax      # 0xe6b0
movq 0x8(%rax), %rsi
movq (%rax), %rdx
callq 0x21c0
cmpl $0x1, %r12d
jne 0x66c0
leaq 0x7cbb(%rip), %r12      # 0xe338
movq 0x7dc4(%rip), %rdi      # 0xe448
leaq 0x356f(%rip), %rsi      # 0x9bfa
movl %r15d, %edx
xorl %eax, %eax
callq 0x2070
movq 0x7db4(%rip), %rdi      # 0xe450
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2100
movslq 0x7db2(%rip), %rcx      # 0xe460
cltq
addq %rcx, %rax
movb $0xa, (%r12,%rax)
movl 0x7daa(%rip), %edi      # 0xe468
jmp 0x66ed
leaq 0x7c71(%rip), %r15      # 0xe338
movq 0x7d8a(%rip), %rdi      # 0xe458
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2100
movslq 0x7d84(%rip), %rcx      # 0xe464
cltq
addq %rcx, %rax
movb $0xa, (%r15,%rax)
pushq $0x2
popq %rdi
incl %eax
movslq %eax, %rdx
leaq 0x7c3f(%rip), %rsi      # 0xe338
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x20c0
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_main.c
// Function: main
int
main(int argc, char *const *argv)
{
    if (qq_get_options(argc, argv) != QQ_OK) {
        return 1;
    }

    if (qq_show_help || qq_show_version) {
        qq_show_help_version_info();
        return 0;
    }

    if (!qq_debug_mode) {
        if (daemon(1, 0) != QQ_OK) {
            qq_log_stderr("daemon(0, 0) failed"); 
            return 1;
        }
    }

    qq_time_init();

    qq_log_init(getpid());

#if (QQ_HAVE_JSON)
    if (qq_cjson_init(QQ_JSON_POOL_SIZE) != 0) {
        qq_log_error(0, "qq_cjson_init() failed");
        return 1;
    }
#endif

    if (qq_cycle_init() == QQ_ERROR) {
        qq_log_error(0, "qq_cycle_init() failed");
        return 1;
    }

    if (qq_signals_init() != QQ_OK) {
        return 1;
    }

    qq_process_cycle(qq_cycle);

#if (QQ_HAVE_JSON)
    qq_cjson_done();
#endif

    qq_cycle_done();
 
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movslq %edi, %rdx
pushq $0x1
popq %rdi
leaq 0x7bd5(%rip), %r8       # 0xe470
leaq 0x7bde(%rip), %r9       # 0xe480
leaq 0x7bcf(%rip), %r10      # 0xe478
cmpq %rdx, %rdi
jge 0x690e
movq (%rsi,%rdi,8), %rax
cmpb $0x2d, (%rax)
jne 0x6946
incq %rax
movzbl (%rax), %ecx
movq %r8, %r11
cmpl $0x3f, %ecx
je 0x68e3
cmpl $0x64, %ecx
je 0x68e0
movq %r8, %r11
cmpl $0x68, %ecx
je 0x68e3
cmpl $0x76, %ecx
jne 0x68e9
movq %r10, %r11
jmp 0x68e3
movq %r9, %r11
movb $0x1, (%r11)
jmp 0x68bb
testl %ecx, %ecx
jne 0x68f2
incq %rdi
jmp 0x68a9
leaq 0x3371(%rip), %rdi      # 0x9c6a
movl %ecx, %esi
xorl %eax, %eax
callq 0x678b
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movb 0x7b5c(%rip), %cl       # 0xe470
movb 0x7b5e(%rip), %al       # 0xe478
movl %ecx, %edx
orb %al, %dl
testb $0x1, %dl
je 0x6959
testb $0x1, %cl
je 0x69b9
leaq 0x334a(%rip), %rdi      # 0x9c7d
callq 0x6a0d
cmpb $0x0, 0x7b39(%rip)      # 0xe478
jne 0x69bd
jmp 0x69c9
leaq 0x330a(%rip), %rdi      # 0x9c57
movq %rax, %rsi
xorl %eax, %eax
callq 0x678b
jmp 0x6902
cmpb $0x0, 0x7b20(%rip)      # 0xe480
jne 0x6982
pushq $0x1
popq %rbx
movl %ebx, %edi
xorl %esi, %esi
callq 0x2240
testl %eax, %eax
je 0x6982
leaq 0x329c(%rip), %rdi      # 0x9c15
xorl %eax, %eax
callq 0x678b
jmp 0x6905
pushq $0x1
popq %rbx
callq 0x81b8
callq 0x22b0
movl %eax, %edi
callq 0x64d8
movl $0x10000, %edi          # imm = 0x10000
callq 0x3dfc
testl %eax, %eax
je 0x69d0
leaq 0x327e(%rip), %rsi      # 0x9c29
xorl %edi, %edi
xorl %eax, %eax
callq 0x65bd
jmp 0x6905
testb $0x1, %al
je 0x69c9
leaq 0x3344(%rip), %rdi      # 0x9d08
callq 0x6a0d
xorl %ebx, %ebx
jmp 0x6905
callq 0x2988
cmpq $-0x1, %rax
je 0x6a04
callq 0x775c
testq %rax, %rax
jne 0x6905
leaq 0x78c0(%rip), %rax      # 0xe2b0
movq (%rax), %rdi
callq 0x77f9
callq 0x3e3c
callq 0x2a75
jmp 0x69c9
leaq 0x3235(%rip), %rsi      # 0x9c40
jmp 0x69ab
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_md5.c
// Function: MD5Final
void MD5Final(MD5_CTX *context,unsigned char digest[16])
{
    unsigned int index = 0, padlen = 0;
    unsigned char bits[8];

    index = (context->count[0] >> 3) & 0x3F;
    padlen = (index < 56)?(56-index):(120-index);
    MD5Encode(bits,context->count,8);
    MD5Update(context,PADDING,padlen);
    MD5Update(context,bits,8);
    MD5Encode(digest,context->state,16);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdi), %eax
shrl $0x3, %eax
andl $0x3f, %eax
xorl %r15d, %r15d
cmpl $0x38, %eax
setae %r15b
shll $0x6, %r15d
orl $0x38, %r15d
subl %eax, %r15d
leaq -0x30(%rbp), %r12
pushq $0x8
popq %r13
movq %r12, %rdi
movq %r14, %rsi
movl %r13d, %edx
callq 0x72ed
leaq 0x6f1c(%rip), %rsi      # 0xe1d0
movq %r14, %rdi
movl %r15d, %edx
callq 0x6a4e
movq %r14, %rdi
movq %r12, %rsi
movl %r13d, %edx
callq 0x6a4e
addq $0x8, %r14
pushq $0x10
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x72ed
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_md5.c
// Function: MD5Decode
void MD5Decode(unsigned int *output,unsigned char *input,unsigned int len)
{
    unsigned int i = 0,j = 0;

    while(j < len) {
        output[i] = (input[j]) |
                    (input[j+1] << 8) |
                    (input[j+2] << 16) |
                    (input[j+3] << 24);
        i ++;
        j += 4;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
addl $0x3, %edx
shrl $0x2, %edx
xorl %eax, %eax
cmpq %rax, %rdx
je 0x733f
movl (%rsi,%rax,4), %ecx
movl %ecx, (%rdi,%rax,4)
incq %rax
jmp 0x732f
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/app/qq_mysql.c
// Function: qq_mysql_init
qq_int_t qq_mysql_init(void)
{
    qq_mysql = mysql_init(NULL);
    if (qq_mysql == NULL) {
        qq_log_error(0, "mysql_init() failed");
        return QQ_ERROR;
    }

    if (!mysql_real_connect(qq_mysql,
        QQ_MYSQL_HOST_NAME,
        QQ_MYSQL_USER_NAME,
        QQ_MYSQL_USER_PWD,
        QQ_MYSQL_DB_NAME,
        QQ_MYSQL_DB_PORT,
        NULL,
        0))
    {
        qq_log_error(0, "mysql_real_connect() failed");
        return QQ_ERROR;
    }

    if (mysql_query(qq_mysql, "set names utf8")) {
        qq_log_error(0, "mysql_query(set names utf8) failed");
        return QQ_ERROR;
    }
    

    return QQ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
xorl %edi, %edi
callq 0x20f0
movq %rax, 0x7136(%rip)      # 0xe490
testq %rax, %rax
je 0x73b5
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
leaq 0x29d3(%rip), %rsi      # 0x9d40
leaq 0x29d6(%rip), %rdx      # 0x9d4a
leaq 0x29d4(%rip), %rcx      # 0x9d4f
leaq 0x29d6(%rip), %r8       # 0x9d58
movq %rax, %rdi
movl $0xcea, %r9d            # imm = 0xCEA
callq 0x2140
testq %rax, %rax
je 0x73be
movq 0x70f4(%rip), %rdi      # 0xe490
leaq 0x29de(%rip), %rsi      # 0x9d81
callq 0x2190
testl %eax, %eax
je 0x73d7
leaq 0x29dd(%rip), %rsi      # 0x9d90
jmp 0x73c5
leaq 0x1d38(%rip), %rsi      # 0x90f4
jmp 0x73c5
leaq 0x29a0(%rip), %rsi      # 0x9d65
xorl %edi, %edi
xorl %eax, %eax
callq 0x65bd
pushq $-0x1
popq %rax
addq $0x10, %rsp
popq %rbp
retq
xorl %eax, %eax
jmp 0x73d1
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/app/qq_mysql.c
// Function: qq_mysql_wifi_device_select
MYSQL_RES *
qq_mysql_wifi_device_select(char *device_id)
{
    memset(qq_str, 0, 256);
    sprintf(qq_str, "SELECT app_id,app_type FROM wifi_device WHERE device_id='%s'", device_id);

    if (mysql_query(qq_mysql, qq_str)) {
        qq_log_error(0, "qq_mysql_wifi_device_select(%s) query failed", device_id);
        return NULL;
    }

    qq_res = mysql_store_result(qq_mysql);
    if (qq_res == NULL) {
        qq_log_error(0, "qq_mysql_wifi_device_select(%s) result failed", device_id);
        return NULL;
    }

    return qq_res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x70a3(%rip), %r14      # 0xe4a0
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x2160
leaq 0x29a0(%rip), %rsi      # 0x9db3
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2070
movq 0x7069(%rip), %rdi      # 0xe490
movq %r14, %rsi
callq 0x2190
testl %eax, %eax
je 0x744b
leaq 0x29b6(%rip), %rsi      # 0x9df0
xorl %r14d, %r14d
xorl %edi, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x65bd
jmp 0x7466
movq 0x703e(%rip), %rdi      # 0xe490
callq 0x2150
movq %rax, %r14
movq %rax, 0x713f(%rip)      # 0xe5a0
testq %rax, %rax
je 0x746e
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x29a8(%rip), %rsi      # 0x9e1d
jmp 0x743a
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/app/qq_mysql.c
// Function: qq_mysql_wifi_device_insert_into
qq_int_t
qq_mysql_wifi_device_insert_into(char *device_id)
{
    memset(qq_str, 0, 256);
    sprintf(qq_str, "INSERT INTO wifi_device(device_id, app_id, app_type) VALUES ('%s', '%s', %d)",
        device_id, "\0", 0);

    if (mysql_query(qq_mysql, qq_str)) {
        qq_log_error(0, "qq_mysql_wifi_insert_into(device_id: %s) failed", device_id);
        return QQ_ERROR;
    }

    return QQ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x7015(%rip), %r15      # 0xe4a0
xorl %r14d, %r14d
movl $0x100, %edx            # imm = 0x100
movq %r15, %rdi
xorl %esi, %esi
callq 0x2160
leaq 0x29a7(%rip), %rsi      # 0x9e4b
leaq 0x2b10(%rip), %rcx      # 0x9fbb
movq %r15, %rdi
movq %rbx, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x2070
movq 0x6fce(%rip), %rdi      # 0xe490
movq %r15, %rsi
callq 0x2190
testl %eax, %eax
je 0x74e5
leaq 0x29c3(%rip), %rsi      # 0x9e98
xorl %edi, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x65bd
pushq $-0x1
popq %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/app/qq_mysql.c
// Function: qq_mysql_wifi_device_update
qq_int_t
qq_mysql_wifi_device_update(char *device_id, char *app_id, int app_type)
{
    memset(qq_str, 0, 256);
    sprintf(qq_str, "UPDATE wifi_device SET app_id='%s' and app_type=%d WHERE device_id='%s'",
        app_id, app_type, device_id);

    if (mysql_query(qq_mysql, qq_str)) {
        qq_log_error(0, "qq_mysql_wifi_device_update(device_id: %s, app_id: %s, app_type: %d) failed",
            device_id, app_id, app_type);
        return QQ_ERROR;
    }

    return QQ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x6f90(%rip), %r13      # 0xe4a0
xorl %r12d, %r12d
movl $0x100, %edx            # imm = 0x100
movq %r13, %rdi
xorl %esi, %esi
callq 0x2160
leaq 0x299f(%rip), %rsi      # 0x9ec8
movq %r13, %rdi
movq %r14, %rdx
movl %ebx, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x2070
movq 0x6f4e(%rip), %rdi      # 0xe490
movq %r13, %rsi
callq 0x2190
testl %eax, %eax
je 0x756b
leaq 0x29bb(%rip), %rsi      # 0x9f10
xorl %edi, %edi
movq %r15, %rdx
movq %r14, %rcx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x65bd
pushq $-0x1
popq %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/app/qq_mysql.c
// Function: qq_mysql_wifi_device_delete
qq_int_t
qq_mysql_wifi_device_delete(char *device_id)
{
    memset(qq_str, 0, 256);
    sprintf(qq_str, "DELETE FROM wifi_device WHERE device_id='%s'", device_id);

    if (mysql_query(qq_mysql, qq_str)) {
        qq_log_error(0, "qq_mysql_wifi_device_delete(device_id: %s) failed", device_id);
        return QQ_ERROR;
    }

    return QQ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x6f0f(%rip), %r15      # 0xe4a0
xorl %r14d, %r14d
movl $0x100, %edx            # imm = 0x100
movq %r15, %rdi
xorl %esi, %esi
callq 0x2160
leaq 0x29b2(%rip), %rsi      # 0x9f5c
movq %r15, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2070
movq 0x6ed2(%rip), %rdi      # 0xe490
movq %r15, %rsi
callq 0x2190
testl %eax, %eax
je 0x75e1
leaq 0x29b8(%rip), %rsi      # 0x9f89
xorl %edi, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x65bd
pushq $-0x1
popq %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_palloc.c
// Function: qq_create_pool
qq_pool_t *
qq_create_pool(size_t size)
{
    qq_pool_t  *p;

    p = qq_memalign(QQ_POOL_ALIGNMENT, size);
    if (p == NULL) {
        return NULL;
    }

    p->last = (u_char *) p + sizeof(qq_pool_t);
    p->end = (u_char *) p + size;

    return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x10
popq %rdi
movq %rbx, %rsi
callq 0x24b0
testq %rax, %rax
je 0x7647
leaq 0x10(%rax), %rcx
movq %rcx, (%rax)
addq %rax, %rbx
movq %rbx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_palloc.c
// Function: qq_pcalloc
void *
qq_pcalloc(qq_pool_t *pool, size_t size)
{
    void *p;

    p = qq_palloc(pool, size);
    if (p) {
        memset(p, 0, size);
    }

    return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
movq (%rdi), %rdi
movq 0x8(%rax), %rcx
addq $0x7, %rdi
andq $-0x8, %rdi
subq %rdi, %rcx
cmpq %rsi, %rcx
jb 0x76c9
movq %rsi, %rdx
leaq (%rdi,%rsi), %rcx
movq %rcx, (%rax)
testq %rdi, %rdi
je 0x76c9
xorl %esi, %esi
popq %rbp
jmp 0x2160
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/core/qq_palloc.c
// Function: qq_pcnalloc
void *
qq_pcnalloc(qq_pool_t *pool, size_t size)
{
    void *p;

    p = qq_pnalloc(pool, size);
    if (p) {
        memset(p, 0, size);
    }

    return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
movq (%rdi), %rdi
movq 0x8(%rax), %rcx
subq %rdi, %rcx
cmpq %rsi, %rcx
jb 0x76fa
movq %rsi, %rdx
leaq (%rdi,%rsi), %rcx
movq %rcx, (%rax)
testq %rdi, %rdi
je 0x76fa
xorl %esi, %esi
popq %rbp
jmp 0x2160
xorl %eax, %eax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/qq-smart[P]qq_sh_server/os/qq_process.c
// Function: qq_signals_init
qq_int_t
qq_signals_init(void)
{
    qq_signal_t       *sig;
    struct sigaction   sa;

    for (sig = signals; sig->signo != 0; sig++) {
        memset(&sa, 0, sizeof(struct sigaction));
        sa.sa_handler = sig->handler;
        sigemptyset(&sa.sa_mask);
        if (sigaction(sig->signo, &sa, NULL) == -1) {
            qq_log_error(errno, "sigaction(%s) failed", sig->signame);
            return QQ_ERROR;
        }
    }

    return QQ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa0, %rsp
leaq -0xb0(%rbp), %r14
leaq 0x6a9c(%rip), %r12      # 0xe218
xorl %ebx, %ebx
leaq -0xb8(%rbp), %r15
cmpl $0x0, -0x8(%r12)
je 0x77e6
movl $0x90, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2160
movq 0x10(%r12), %rax
movq %rax, -0xb8(%rbp)
movq %r14, %rdi
callq 0x2250
movl -0x8(%r12), %edi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2260
cmpl $-0x1, %eax
je 0x77ca
addq $0x20, %r12
jmp 0x7785
callq 0x2030
movl (%rax), %edi
movq (%r12), %rdx
leaq 0x2802(%rip), %rsi      # 0x9fde
xorl %eax, %eax
callq 0x65bd
pushq $-0x1
popq %rbx
movq %rbx, %rax
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq