LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0x5910
jp 0x5910
testq %rsi, %rsi
je 0x5961
movq %rsi, %rdi
movl $0x2, %esi
callq 0x5831
jmp 0x596c
ucomisd 0x4f60(%rip), %xmm2     # 0xa878
jb 0x5982
movsd 0x4f5e(%rip), %xmm0     # 0xa880
ucomisd %xmm2, %xmm0
jb 0x5982
movq %rdi, %r14
xorps %xmm0, %xmm0
cvtsi2sdl 0x28(%rdi), %xmm0
subsd %xmm2, %xmm0
andpd 0x4f81(%rip), %xmm0     # 0xa8c0
movsd 0x4f41(%rip), %xmm1     # 0xa888
ucomisd %xmm0, %xmm1
jb 0x5982
testq %rsi, %rsi
je 0x599b
movq %rsi, %rdi
movl $0x15, %esi
callq 0x5831
jmp 0x59a6
movl $0x2, %edi
callq *0x984c(%rip)           # 0xf1b8
movq %rax, %rbx
testq %rax, %rax
je 0x5a27
movw $0x30, (%rbx)
jmp 0x5a61
movapd %xmm2, -0x20(%rbp)
testq %rsi, %rsi
je 0x59c8
movq %rsi, %rdi
movl $0x40, %esi
callq 0x5831
jmp 0x59d3
movl $0x15, %edi
callq *0x9812(%rip)           # 0xf1b8
movq %rax, %rbx
testq %rax, %rax
je 0x5a27
movl 0x28(%r14), %edx
leaq 0x4c7a(%rip), %rsi      # 0xa633
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2070
jmp 0x5a61
movl $0x40, %edi
callq *0x97e5(%rip)           # 0xf1b8
movq %rax, %rbx
testq %rax, %rax
movapd -0x20(%rbp), %xmm0
je 0x5a27
callq 0x22d0
movapd -0x20(%rbp), %xmm4
movapd 0x4ece(%rip), %xmm2     # 0xa8c0
movapd %xmm4, %xmm1
andpd %xmm2, %xmm1
movsd 0x4e8e(%rip), %xmm3     # 0xa890
ucomisd %xmm1, %xmm3
jbe 0x5a2b
subsd %xmm4, %xmm0
andpd %xmm2, %xmm0
movsd 0x4e70(%rip), %xmm2     # 0xa888
ucomisd %xmm0, %xmm2
jb 0x5a2b
leaq 0x4f6c(%rip), %rsi      # 0xa991
jmp 0x5a53
xorl %ebx, %ebx
jmp 0x5a61
movsd 0x4e65(%rip), %xmm0     # 0xa898
ucomisd %xmm1, %xmm0
ja 0x5a4c
ucomisd 0x4e5f(%rip), %xmm1     # 0xa8a0
ja 0x5a4c
leaq 0x4f4f(%rip), %rsi      # 0xa999
jmp 0x5a53
leaq 0x4f43(%rip), %rsi      # 0xa996
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_O1/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
movl $0x20, %edi
callq 0x2473
testq %rax, %rax
je 0x65f1
movl %r12d, 0x8(%rax)
movl %r15d, 0xc(%rax)
movq %r14, 0x10(%rax)
movq %rbx, 0x18(%rax)
leaq 0x8cd7(%rip), %rcx      # 0xf2b0
movq (%rcx), %rdx
movq 0x50(%rdx), %rsi
testq %rsi, %rsi
je 0x660f
movq %rax, (%rsi)
movq (%rcx), %rdx
addq $0x50, %rdx
jmp 0x6617
leaq 0x43b5(%rip), %rsi      # 0xa9ad
movl $0x20, %edx
xorl %edi, %edi
xorl %eax, %eax
callq 0x6c5d
movq $-0x1, %rax
jmp 0x6623
movq %rax, 0x50(%rdx)
addq $0x48, %rdx
movq %rax, (%rdx)
movq (%rcx), %rax
incq 0x38(%rax)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x4109(%rip), %rdi      # 0xabb8
xorl %eax, %eax
callq 0x6daa
cmpq $0x0, 0x38(%rbx)
je 0x6b69
movq 0x40(%rbx), %r13
leaq 0x4109(%rip), %r14      # 0xabd5
xorl %r15d, %r15d
movq 0x58(%r13), %r12
testq %r12, %r12
je 0x6b15
movq 0x8(%r12), %rdi
testb $0x8, 0x8(%rdi)
je 0x6aed
movl $0x1, %esi
callq 0x2c96
movq 0x40(%r12), %rdi
testq %rdi, %rdi
je 0x6b04
cmpl $0x2, 0x48(%r12)
jne 0x6b04
callq 0x2338
movq %r12, %rdi
callq 0x283c
movl $0xffffffff, 0x18(%r12) # imm = 0xFFFFFFFF
leaq 0x18(%r13), %r12
movl (%r13), %edx
movq %r14, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x6daa
movl (%r13), %edi
callq 0x2320
cmpl $-0x1, %eax
jne 0x6b50
callq 0x2030
movl (%rax), %edi
leaq 0x40a7(%rip), %rsi      # 0xabed
movq %r12, %rdx
xorl %eax, %eax
callq 0x6c5d
movl $0xffffffff, (%r13)     # imm = 0xFFFFFFFF
incq %r15
addq $0x60, %r13
cmpq 0x38(%rbx), %r15
jb 0x6acf
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x70, %rsp
movl %edi, %ebx
leaq 0x87ac(%rip), %r14      # 0xf338
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x2160
movq %r14, 0x8896(%rip)      # 0xf438
leaq 0x87a2(%rip), %rdi      # 0xf34b
movq %rdi, 0x8890(%rip)      # 0xf440
leaq 0x404d(%rip), %rsi      # 0xac04
movl %ebx, %edx
xorl %eax, %eax
callq 0x2070
leaq 0x8794(%rip), %rax      # 0xf35b
movq %rax, 0x888a(%rip)      # 0xf458
movq %rax, 0x8873(%rip)      # 0xf448
leaq 0x878c(%rip), %rax      # 0xf368
movq %rax, 0x886d(%rip)      # 0xf450
movabsq $0x2300000030, %rax     # imm = 0x2300000030
movq %rax, 0x886c(%rip)      # 0xf460
callq 0x2300
movq %rax, %rbx
movq %rax, %rdi
callq 0x20d0
leaq -0x80(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x21c0
movq %rbx, %rdi
callq 0x20d0
movb $0x2f, -0x80(%rbp,%rax)
movw $0x6f6c, -0x7f(%rbp,%rax) # imm = 0x6F6C
movb $0x67, -0x7d(%rbp,%rax)
movq %r14, %rdi
movl $0x441, %esi            # imm = 0x441
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x21a0
cmpl $-0x1, %eax
movl $0x2, %ecx
cmovnel %eax, %ecx
movl %ecx, 0x8814(%rip)      # 0xf468
addq $0x70, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x8739(%rip), %rdi      # 0xf438
leaq 0x89aa(%rip), %rax      # 0xf6b0
movq 0x8(%rax), %rsi
movq (%rax), %rdx
callq 0x21c0
cmpl $0x1, %r12d
jne 0x6d62
leaq 0x8619(%rip), %r12      # 0xf338
movq 0x8722(%rip), %rdi      # 0xf448
leaq 0x3eda(%rip), %rsi      # 0xac07
movl %r15d, %edx
xorl %eax, %eax
callq 0x2070
movq 0x8712(%rip), %rdi      # 0xf450
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2100
movslq 0x8710(%rip), %rcx      # 0xf460
cltq
addq %rcx, %rax
movb $0xa, (%r12,%rax)
movl 0x8708(%rip), %edi      # 0xf468
jmp 0x6d91
leaq 0x85cf(%rip), %r15      # 0xf338
movq 0x86e8(%rip), %rdi      # 0xf458
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2100
movslq 0x86e2(%rip), %rcx      # 0xf464
cltq
addq %rcx, %rax
movb $0xa, (%r15,%rax)
movl $0x2, %edi
incl %eax
movslq %eax, %rdx
leaq 0x859b(%rip), %rsi      # 0xf338
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x20c0
// File: /workspace/github_c_makefile_star2_O1/qq-smart[P]qq_sh_server/core/qq_log.c
// Function: qq_log_stderr
void
qq_log_stderr(const char *fmt, ...)
{
    u_char   *p, *last;
    va_list   args;
    u_char    errstr[QQ_MAX_LOG_STR];
    int       len;

    last = errstr + QQ_MAX_LOG_STR;

    p = qq_cpymem(errstr, "qq_sh_server: ", 14);

    va_start(args, fmt);
    len = vsnprintf(p, last - QQ_LINEFEED_SIZE - p, fmt, args);
    va_end(args);

    p += len;
    if (p > last - QQ_LINEFEED_SIZE) {
        p = last - QQ_LINEFEED_SIZE;
    }

    qq_linefeed(p);

    (void) write(STDERR_FILENO, errstr, p - errstr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, %r10
leaq -0x1d0(%rbp), %r11
movq %rsi, 0x8(%r11)
movq %rdx, 0x10(%r11)
movq %rcx, 0x18(%r11)
movq %r8, 0x20(%r11)
movq %r9, 0x28(%r11)
testb %al, %al
je 0x6e94
movaps %xmm0, -0x1a0(%rbp)
movaps %xmm1, -0x190(%rbp)
movaps %xmm2, -0x180(%rbp)
movaps %xmm3, -0x170(%rbp)
movaps %xmm4, -0x160(%rbp)
movaps %xmm5, -0x150(%rbp)
movaps %xmm6, -0x140(%rbp)
movaps %xmm7, -0x130(%rbp)
movabsq $0x203a726576726573, %rax # imm = 0x203A726576726573
leaq -0x112(%rbp), %rdi
movq %rax, -0x8(%rdi)
movabsq $0x65735f68735f7171, %rax # imm = 0x65735F68735F7171
movq %rax, -0xe(%rdi)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
leaq -0x20(%rbp), %rcx
movq %rax, (%rcx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rcx)
movq %r11, 0x10(%rcx)
movl $0xf1, %esi
movq %r10, %rdx
callq 0x2180
cltq
leaq (%rax,%rbp), %rcx
addq $-0x112, %rcx           # imm = 0xFEEE
cmpl $0xf2, %eax
leaq -0x21(%rbp), %rsi
cmovlq %rcx, %rsi
leaq -0x20(%rbp), %rcx
leaq -0x111(%rbp,%rax), %rdx
cmovgeq %rcx, %rdx
movb $0xa, (%rsi)
leaq -0x120(%rbp), %rsi
subq %rsi, %rdx
movl $0x2, %edi
callq 0x20c0
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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
cmpl $0x2, %edi
jl 0x6f9d
movslq %edi, %rdx
movl $0x1, %edi
leaq 0x852a(%rip), %r8       # 0xf470
leaq 0x8533(%rip), %r9       # 0xf480
leaq 0x8524(%rip), %r10      # 0xf478
movq (%rsi,%rdi,8), %rax
cmpb $0x2d, (%rax)
jne 0x70a4
incq %rax
movzbl (%rax), %ecx
movq %r8, %r11
cmpl $0x67, %ecx
jg 0x6f7e
cmpl $0x3f, %ecx
je 0x6f8b
cmpl $0x64, %ecx
jne 0x6f91
movq %r9, %r11
jmp 0x6f8b
cmpl $0x68, %ecx
je 0x6f8b
cmpl $0x76, %ecx
jne 0x6fe1
movq %r10, %r11
movb $0x1, (%r11)
jmp 0x6f61
testl %ecx, %ecx
jne 0x6fe1
incq %rdi
cmpq %rdx, %rdi
jne 0x6f54
movb 0x84cd(%rip), %al       # 0xf470
testb %al, %al
jne 0x6ff3
testb $0x1, 0x84ca(%rip)      # 0xf478
jne 0x6ff3
cmpb $0x0, 0x84c9(%rip)      # 0xf480
jne 0x7030
movl $0x1, %ebx
movl $0x1, %edi
xorl %esi, %esi
callq 0x2230
testl %eax, %eax
je 0x7030
leaq 0x3c4d(%rip), %rdi      # 0xac22
xorl %eax, %eax
callq 0x6e2f
jmp 0x7064
leaq 0x3c8f(%rip), %rdi      # 0xac77
movl %ecx, %esi
xorl %eax, %eax
callq 0x6e2f
jmp 0x705f
testb %al, %al
je 0x700d
leaq 0x3c8c(%rip), %rsi      # 0xac8a
movl $0x8a, %edx
movl $0x2, %edi
callq 0x20c0
xorl %ebx, %ebx
cmpb $0x1, 0x8462(%rip)      # 0xf478
jne 0x7064
leaq 0x3cf6(%rip), %rsi      # 0xad15
movl $0x1c, %edx
movl $0x2, %edi
callq 0x20c0
jmp 0x7064
callq 0x8b70
callq 0x22a0
movl %eax, %edi
callq 0x6b78
movl $0x10000, %edi          # imm = 0x10000
callq 0x3ea8
testl %eax, %eax
je 0x706d
leaq 0x3be0(%rip), %rsi      # 0xac36
xorl %edi, %edi
xorl %eax, %eax
callq 0x6c5d
movl $0x1, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
callq 0x29ac
cmpq $-0x1, %rax
je 0x70b7
callq 0x7f24
movl $0x1, %ebx
testq %rax, %rax
jne 0x7064
leaq 0x8222(%rip), %rax      # 0xf2b0
movq (%rax), %rdi
callq 0x7fd3
callq 0x3eec
callq 0x2a9f
xorl %ebx, %ebx
jmp 0x7064
leaq 0x3bb9(%rip), %rdi      # 0xac64
movq %rax, %rsi
xorl %eax, %eax
callq 0x6e2f
jmp 0x705f
leaq 0x3b8f(%rip), %rsi      # 0xac4d
jmp 0x7056
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdi), %eax
shrl $0x3, %eax
andl $0x3f, %eax
xorl %edx, %edx
cmpl $0x38, %eax
setae %dl
shll $0x6, %edx
orl $0x38, %edx
xorl %ecx, %ecx
movl (%r14,%rcx,4), %esi
movl %esi, -0x18(%rbp,%rcx,4)
incq %rcx
cmpq $0x2, %rcx
jne 0x7a20
subl %eax, %edx
leaq 0x7796(%rip), %rsi      # 0xf1d0
movq %r14, %rdi
callq 0x70de
leaq -0x18(%rbp), %rsi
movq %r14, %rdi
movl $0x8, %edx
callq 0x70de
xorl %eax, %eax
movb 0x8(%r14,%rax,4), %cl
movb %cl, (%rbx,%rax,4)
movb 0x9(%r14,%rax,4), %cl
movb %cl, 0x1(%rbx,%rax,4)
movb 0xa(%r14,%rax,4), %cl
movb %cl, 0x2(%rbx,%rax,4)
movb 0xb(%r14,%rax,4), %cl
movb %cl, 0x3(%rbx,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0x7a55
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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, 0x7996(%rip)      # 0xf490
testq %rax, %rax
je 0x7b55
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
leaq 0x3243(%rip), %rsi      # 0xad50
leaq 0x3246(%rip), %rdx      # 0xad5a
leaq 0x3244(%rip), %rcx      # 0xad5f
leaq 0x3246(%rip), %r8       # 0xad68
movq %rax, %rdi
movl $0xcea, %r9d            # imm = 0xCEA
callq 0x2140
testq %rax, %rax
je 0x7b5e
movq 0x7954(%rip), %rdi      # 0xf490
leaq 0x324e(%rip), %rsi      # 0xad91
callq 0x2190
testl %eax, %eax
je 0x7b7b
leaq 0x324d(%rip), %rsi      # 0xada0
jmp 0x7b65
leaq 0x2598(%rip), %rsi      # 0xa0f4
jmp 0x7b65
leaq 0x3210(%rip), %rsi      # 0xad75
xorl %edi, %edi
xorl %eax, %eax
callq 0x6c5d
movq $-0x1, %rax
addq $0x10, %rsp
popq %rbp
retq
xorl %eax, %eax
jmp 0x7b75
// File: /workspace/github_c_makefile_star2_O1/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 0x78ff(%rip), %r14      # 0xf4a0
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
xorl %esi, %esi
callq 0x2160
leaq 0x320c(%rip), %rsi      # 0xadc3
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2070
movq 0x78c5(%rip), %rdi      # 0xf490
movq %r14, %rsi
callq 0x2190
testl %eax, %eax
je 0x7bef
leaq 0x3222(%rip), %rsi      # 0xae00
xorl %r14d, %r14d
xorl %edi, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6c5d
jmp 0x7c0a
movq 0x789a(%rip), %rdi      # 0xf490
callq 0x2150
movq %rax, %r14
movq %rax, 0x799b(%rip)      # 0xf5a0
testq %rax, %rax
je 0x7c12
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x3214(%rip), %rsi      # 0xae2d
jmp 0x7bde
// File: /workspace/github_c_makefile_star2_O1/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 0x7871(%rip), %r15      # 0xf4a0
xorl %r14d, %r14d
movl $0x100, %edx            # imm = 0x100
movq %r15, %rdi
xorl %esi, %esi
callq 0x2160
leaq 0x3213(%rip), %rsi      # 0xae5b
leaq 0x337c(%rip), %rcx      # 0xafcb
movq %r15, %rdi
movq %rbx, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x2070
movq 0x782a(%rip), %rdi      # 0xf490
movq %r15, %rsi
callq 0x2190
testl %eax, %eax
je 0x7c8c
leaq 0x322f(%rip), %rsi      # 0xaea8
xorl %edi, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6c5d
movq $-0x1, %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x77e9(%rip), %r13      # 0xf4a0
xorl %r12d, %r12d
movl $0x100, %edx            # imm = 0x100
movq %r13, %rdi
xorl %esi, %esi
callq 0x2160
leaq 0x3208(%rip), %rsi      # 0xaed8
movq %r13, %rdi
movq %r14, %rdx
movl %ebx, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x2070
movq 0x77a7(%rip), %rdi      # 0xf490
movq %r13, %rsi
callq 0x2190
testl %eax, %eax
je 0x7d15
leaq 0x3224(%rip), %rsi      # 0xaf20
xorl %edi, %edi
movq %r15, %rdx
movq %r14, %rcx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x6c5d
movq $-0x1, %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_O1/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 0x7765(%rip), %r15      # 0xf4a0
xorl %r14d, %r14d
movl $0x100, %edx            # imm = 0x100
movq %r15, %rdi
xorl %esi, %esi
callq 0x2160
leaq 0x3218(%rip), %rsi      # 0xaf6c
movq %r15, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2070
movq 0x7728(%rip), %rdi      # 0xf490
movq %r15, %rsi
callq 0x2190
testl %eax, %eax
je 0x7d8e
leaq 0x321e(%rip), %rsi      # 0xaf99
xorl %edi, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6c5d
movq $-0x1, %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x10, %edi
movq %rbx, %rsi
callq 0x24a0
testq %rax, %rax
je 0x7df7
leaq 0x10(%rax), %rcx
movq %rcx, (%rax)
addq %rax, %rbx
movq %rbx, 0x8(%rax)
jmp 0x7df9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %rbx
pushq %rax
movq %rsi, %rdx
movq (%rdi), %rbx
movq 0x8(%rdi), %rax
addq $0x7, %rbx
andq $-0x8, %rbx
subq %rbx, %rax
cmpq %rsi, %rax
jae 0x7e6a
xorl %ebx, %ebx
jmp 0x7e73
movq %rbx, %rax
addq %rdx, %rax
movq %rax, (%rdi)
testq %rbx, %rbx
je 0x7e82
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2160
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %rbx
pushq %rax
movq %rsi, %rdx
movq (%rdi), %rbx
movq 0x8(%rdi), %rax
subq %rbx, %rax
cmpq %rsi, %rax
jae 0x7ea8
xorl %ebx, %ebx
jmp 0x7eaf
leaq (%rbx,%rdx), %rax
movq %rax, (%rdi)
testq %rbx, %rbx
je 0x7ebe
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2160
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
cmpl $0x0, 0x72d3(%rip)      # 0xf210
je 0x7f9b
leaq 0x72ea(%rip), %r12      # 0xf230
leaq -0xb0(%rbp), %r14
leaq -0xb8(%rbp), %r15
xorl %ebx, %ebx
movl $0x98, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x2160
movq -0x8(%r12), %rax
movq %rax, -0xb8(%rbp)
movq %r14, %rdi
callq 0x2240
movl -0x20(%r12), %edi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2250
cmpl $-0x1, %eax
je 0x7f9f
cmpl $0x0, (%r12)
leaq 0x20(%r12), %r12
jne 0x7f56
jmp 0x7fc0
xorl %ebx, %ebx
jmp 0x7fc0
callq 0x2030
movl (%rax), %edi
movq -0x18(%r12), %rdx
leaq 0x303c(%rip), %rsi      # 0xafee
xorl %eax, %eax
callq 0x6c5d
movq $-0x1, %rbx
movq %rbx, %rax
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/qq-smart[P]qq_sh_server/core/qq_queue.c
// Function: qq_queue_sort
void
qq_queue_sort(qq_queue_t *queue,
    qq_int_t (*cmp)(const qq_queue_t *, const qq_queue_t *))
{
    qq_queue_t  *q, *prev, *next;

    q = qq_queue_head(queue);
    if (q == qq_queue_last(queue)) {
        return;
    }

    for (q = qq_queue_next(q); q != qq_queue_sentinel(queue); q = next) {
        prev = qq_queue_prev(q);
        next = qq_queue_next(q);

        qq_queue_remove(q);

        do {
            if (cmp(prev, q) <= 0) {
                break;
            }

            prev = qq_queue_prev(prev);

        } while (prev != qq_queue_sentinel(queue));

        qq_queue_insert_after(prev, q);
    }
}

// Assembly:
movq 0x8(%rdi), %rax
cmpq (%rdi), %rax
je 0x8094
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x8(%rax), %r13
cmpq %rdi, %r13
je 0x8086
movq %rsi, %rbx
movq %r13, %r15
movq (%r13), %r12
movq 0x8(%r13), %r13
movq %r12, (%r13)
movq (%r15), %rax
movq %r13, 0x8(%rax)
movq %r12, %rdi
movq %r15, %rsi
callq *%rbx
testq %rax, %rax
jle 0x806d
movq (%r12), %r12
cmpq %r14, %r12
jne 0x8057
movq 0x8(%r12), %rax
movq %rax, 0x8(%r15)
movq %r15, (%rax)
movq %r12, (%r15)
movq %r15, 0x8(%r12)
cmpq %r14, %r13
jne 0x8041
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/qq-smart[P]qq_sh_server/core/qq_string.c
// Function: qq_cpystrn
u_char *
qq_cpystrn(u_char *dst, u_char *src, size_t n)
{
    if (n == 0) {
        return dst;
    }

    while (--n) {
        *dst = *src;

        if (*dst == '\0') {
            return dst;
        }

        dst++;
        src++;
    }

    *dst = '\0';

    return dst;
}

// Assembly:
movq %rdi, %rax
testq %rdx, %rdx
je 0x878a
decq %rdx
je 0x877e
xorl %ecx, %ecx
movb (%rsi,%rcx), %dil
movb %dil, (%rax,%rcx)
testb %dil, %dil
je 0x8787
incq %rcx
cmpq %rcx, %rdx
jne 0x8766
addq %rcx, %rax
pushq %rbp
movq %rsp, %rbp
movb $0x0, (%rax)
popq %rbp
retq
addq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/qq-smart[P]qq_sh_server/core/qq_string.c
// Function: qq_hex_dump
u_char *
qq_hex_dump(u_char *dst, u_char *src, size_t len)
{
    static u_char  hex[] = "0123456789abcdef";

    while (len--) {
        *dst++ = hex[*src >> 4];
        *dst++ = hex[*src++ & 0xf];
    }

    return dst;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
testq %rdx, %rdx
je 0x87d5
xorl %ecx, %ecx
leaq 0x2890(%rip), %rdi      # 0xb030
xorl %r8d, %r8d
movzbl (%rsi,%r8), %r9d
shrl $0x4, %r9d
movb (%r9,%rdi), %r9b
movb %r9b, (%rax,%r8,2)
movzbl (%rsi,%r8), %r9d
andl $0xf, %r9d
movb (%r9,%rdi), %r9b
movb %r9b, 0x1(%rax,%r8,2)
incq %r8
addq $-0x2, %rcx
cmpq %r8, %rdx
jne 0x87a3
subq %rcx, %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/qq-smart[P]qq_sh_server/core/qq_string.c
// Function: qq_str_to_hex
qq_int_t
qq_str_to_hex(u_char *str, u_char *hex, size_t strlen)
{
    if (strlen % 2) {
        return QQ_ERROR;
    }

    while (strlen) {
        if (*str >= 48 && *str <= 57) {
            *hex = *str - 48;
        } else if (*str >= 65 && *str <= 70) {
            *hex = *str - 55;
        } else if (*str >= 97 && *str <= 102) {
            *hex = *str - 87;
        } else {
            return QQ_ERROR;
        }

        str ++;
        *hex = *hex << 4;

        if (*str >= 48 && *str <= 57) {
            *hex += *str - 48;
        } else if (*str >= 65 && *str <= 70) {
            *hex += *str - 55;
        } else if (*str >= 97 && *str <= 102) {
            *hex += *str - 87;
        } else {
            return QQ_ERROR;
        }

        str ++;
        hex ++;

        strlen -= 2;
    }

    return QQ_OK;
}

// Assembly:
movq $-0x1, %rax
testb $0x1, %dl
jne 0x887c
testq %rdx, %rdx
je 0x887a
pushq %rbp
movq %rsp, %rbp
xorl %ecx, %ecx
movb (%rdi,%rcx), %r8b
leal -0x30(%r8), %r10d
movb $-0x30, %r9b
cmpb $0xa, %r10b
jb 0x8821
leal -0x41(%r8), %r10d
movb $-0x37, %r9b
cmpb $0x6, %r10b
jb 0x8821
leal -0x61(%r8), %r10d
movb $-0x57, %r9b
cmpb $0x5, %r10b
ja 0x8878
addb %r9b, %r8b
shlb $0x4, %r8b
movb %r8b, (%rsi)
movb 0x1(%rdi,%rcx), %r9b
leal -0x30(%r9), %r10d
cmpb $0x9, %r10b
ja 0x8843
addb %r8b, %r9b
addb $-0x30, %r9b
jmp 0x8867
leal -0x41(%r9), %r10d
cmpb $0x5, %r10b
ja 0x8856
addb %r8b, %r9b
addb $-0x37, %r9b
jmp 0x8867
leal -0x61(%r9), %r10d
cmpb $0x5, %r10b
ja 0x8878
addb %r8b, %r9b
addb $-0x57, %r9b
movb %r9b, (%rsi)
incq %rsi
addq $0x2, %rcx
cmpq %rcx, %rdx
jne 0x87f6
xorl %eax, %eax
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/qq-smart[P]qq_sh_server/core/qq_string.c
// Function: qq_str_rbtree_insert_value
void
qq_str_rbtree_insert_value(qq_rbtree_node_t *temp,
    qq_rbtree_node_t *node, qq_rbtree_node_t *sentinel)
{
    qq_str_rbtree_node_t   *n, *t;
    qq_rbtree_node_t      **p;

    for ( ;; ) {
        n = (qq_str_rbtree_node_t *) node;
        t = (qq_str_rbtree_node_t *) temp;

        if (node->key != temp->key) {
            p = (node->key < temp->key) ? &temp->left : &temp->right;
        } else if (n->str.len != t->str.len) {
            p = (n->str.len < t->str.len) ? &temp->left : &temp->right;
        } else {
            p = (memcmp(n->str.data, t->str.data, n->str.len) < 0)
                 ? &temp->left : &temp->right;
        }

        if (*p == sentinel) {
            break;
        }

        temp = *p;
    }

    *p = node;
    node->parent = temp;
    node->left = sentinel;
    node->right = sentinel;
    qq_rbt_red(node);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movq (%rsi), %r12
movq %rdi, %r15
cmpq (%rdi), %r12
jne 0x88b5
movq 0x28(%rbx), %rdx
cmpq 0x28(%r15), %rdx
jne 0x88b5
movq 0x30(%rbx), %rdi
movq 0x30(%r15), %rsi
callq 0x20e0
shrl $0x1f, %eax
jmp 0x88b8
setb %al
xorb $0x1, %al
movzbl %al, %eax
movq 0x8(%r15,%rax,8), %rdi
cmpq %r14, %rdi
jne 0x8891
leaq 0x8(,%rax,8), %rax
movq %rbx, (%r15,%rax)
movq %r15, 0x18(%rbx)
movq %r14, 0x8(%rbx)
movq %r14, 0x10(%rbx)
movb $0x1, 0x20(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/qq-smart[P]qq_sh_server/core/qq_string.c
// Function: qq_str_rbtree_lookup
qq_str_rbtree_node_t *
qq_str_rbtree_lookup(qq_rbtree_t *rbtree, qq_str_t *val, uint32_t hash)
{
    qq_int_t               rc;
    qq_str_rbtree_node_t  *n;
    qq_rbtree_node_t      *node, *sentinel;

    node = rbtree->root;
    sentinel = rbtree->sentinel;

    while (node != sentinel) {
        n = (qq_str_rbtree_node_t *) node;

        if (hash != node->key) {
            node = (hash < node->key) ? node->left : node->right;
            continue;
        }

        if (val->len != n->str.len) {
            node = (val->len < n->str.len) ? node->left : node->right;
            continue;
        }

        rc = memcmp(val->data, n->str.data, val->len);
        if (rc < 0) {
            node = node->left;
            continue;
        }

        if (rc > 0) {
            node = node->right;
            continue;
        }

        return n;
    }

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq (%rdi), %rbx
movq 0x8(%rdi), %r15
cmpq %r15, %rbx
je 0x8952
movq %rsi, %r14
movl %edx, %r12d
cmpq %r12, (%rbx)
jne 0x8936
movq (%r14), %rdx
cmpq 0x28(%rbx), %rdx
jne 0x893b
movq 0x8(%r14), %rdi
movq 0x30(%rbx), %rsi
callq 0x20e0
movl $0x8, %ecx
testl %eax, %eax
js 0x8949
movl $0x10, %ecx
jne 0x8949
jmp 0x8954
setbe %al
jmp 0x893e
setae %al
movzbl %al, %eax
leaq 0x8(,%rax,8), %rcx
movq (%rbx,%rcx), %rbx
cmpq %r15, %rbx
jne 0x8909
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/qq-smart[P]qq_sh_server/os/qq_tcp_recv.c
// Function: qq_tcp_recv
ssize_t
qq_tcp_recv(qq_connection_t *c, u_char *buf, size_t size)
{
    ssize_t       n;
    qq_err_t      err;
    qq_event_t   *rev;

    rev = c->read;

#if (QQ_HAVE_EPOLLRDHUP)
    qq_log_debug("recv: eof:%d, avail:%d", rev->pending_eof, rev->available);
    if (!rev->available && !rev->pending_eof) {
        rev->ready = 0;
        return QQ_AGAIN;
    }
#endif

    do {
        n = recv(c->fd, buf, size, 0);
        qq_log_debug("recv: fd:%d n:%d of size:%d", c->fd, n, size);

        if (n == 0) {
            rev->ready = 0;
            rev->eof = 1;
            return 0;
        }

        if (n > 0) {
#if (QQ_HAVE_EPOLLRDHUP)
            if ((size_t) n < size) {
                if (!rev->pending_eof) {
                    rev->ready = 0;
                }
                rev->available = 0;
            }
            return n;
#endif

            if ((size_t) n < size) {
                rev->ready = 0;
            }
            return n;
        }

        err = errno;
        if (err == QQ_EAGAIN || err == QQ_EINTR) {
            qq_log_debug("recv() not ready");
            n = QQ_AGAIN;
        } else {
            qq_log_debug("recv() failed");
            n = QQ_ERROR;
            break;
        }
    } while (err == QQ_EINTR);

    rev->ready = 0;
    rev->error = 1;

    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rdi), %r13
movl 0x8(%r13), %edx
movl %edx, %esi
shrl $0xe, %esi
andl $0x1, %esi
shrl $0x14, %edx
andl $0x1, %edx
leaq 0x26ad(%rip), %rdi      # 0xb041
xorl %eax, %eax
callq 0x6daa
movl 0x8(%r13), %eax
testl $0x104000, %eax         # imm = 0x104000
je 0x8a11
movq %r13, -0x30(%rbp)
leaq 0x26a7(%rip), %r13      # 0xb058
movl 0x18(%r15), %edi
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x20b0
movq %rax, %r12
movl 0x18(%r15), %esi
movq %r13, %rdi
movq %rax, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x6daa
testq %r12, %r12
je 0x8a1f
jg 0x8a36
callq 0x2030
movl (%rax), %r12d
cmpl $0xb, %r12d
je 0x89f4
cmpl $0x4, %r12d
jne 0x8a5d
leaq 0x2679(%rip), %rdi      # 0xb074
xorl %eax, %eax
callq 0x6daa
cmpl $0x4, %r12d
je 0x89b1
movq $-0x2, %r12
jmp 0x8a72
andl $0xffefbfdf, %eax       # imm = 0xFFEFBFDF
movq $-0x2, %r12
jmp 0x8a84
movl $0xfffffedf, %eax       # imm = 0xFFFFFEDF
movq -0x30(%rbp), %r13
andl 0x8(%r13), %eax
orl $0x100, %eax            # imm = 0x100
xorl %r12d, %r12d
jmp 0x8a84
cmpq %rbx, %r12
jae 0x8a88
movq -0x30(%rbp), %r13
movl 0x8(%r13), %eax
btl $0xe, %eax
jb 0x8a52
andl $0xffffbfdf, %eax       # imm = 0xFFFFBFDF
movl %eax, 0x8(%r13)
movl $0xffefffff, %eax       # imm = 0xFFEFFFFF
andl 0x8(%r13), %eax
jmp 0x8a84
leaq 0x2621(%rip), %rdi      # 0xb085
xorl %eax, %eax
callq 0x6daa
movq $-0x1, %r12
movl $0xfffffddf, %eax       # imm = 0xFFFFFDDF
movq -0x30(%rbp), %r13
andl 0x8(%r13), %eax
orl $0x200, %eax            # imm = 0x200
movl %eax, 0x8(%r13)
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/qq-smart[P]qq_sh_server/os/qq_tcp_send.c
// Function: qq_tcp_send
ssize_t
qq_tcp_send(qq_connection_t *c, u_char *buf, size_t size)
{
    ssize_t       n;
    qq_err_t      err;
    qq_event_t   *wev;

    wev = c->write;

    for ( ;; ) {
        n = send(c->fd, buf, size, 0);

        qq_log_debug("send: fd:%d n:%d of size:%d", c->fd, n, size);

        if (n > 0) {
            if (n < (ssize_t) size) {
                wev->ready = 0;
            }
            return n;
        }

        err = errno;
        if (n == 0) {
            qq_log_error(err, "send() returned zero");
            wev->ready = 0;
            return n;
        }

        if (err == QQ_EAGAIN || err == QQ_EINTR) {
            wev->ready = 0;

            qq_log_debug("send() not ready");

            if (err == QQ_EAGAIN) {
                return QQ_AGAIN;
            }
        } else {
            wev->error = 1;
            return QQ_ERROR;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x10(%rdi), %rax
movq %rax, -0x30(%rbp)
movl 0x18(%r15), %edi
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x2130
movq %rax, %r13
movl 0x18(%r15), %esi
leaq 0x25b9(%rip), %rdi      # 0xb093
movq %rax, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x6daa
testq %r13, %r13
jg 0x8b2a
callq 0x2030
movl (%rax), %r12d
testq %r13, %r13
je 0x8b31
cmpl $0xb, %r12d
je 0x8b05
cmpl $0x4, %r12d
jne 0x8b4f
movq -0x30(%rbp), %rax
andb $-0x21, 0x8(%rax)
leaq 0x25b0(%rip), %rdi      # 0xb0c4
xorl %eax, %eax
callq 0x6daa
cmpl $0xb, %r12d
jne 0x8abb
movq $-0x2, %r13
jmp 0x8b5e
cmpq %rbx, %r13
jl 0x8b45
jmp 0x8b5e
leaq 0x2577(%rip), %rsi      # 0xb0af
xorl %r13d, %r13d
movl %r12d, %edi
xorl %eax, %eax
callq 0x6c5d
movq -0x30(%rbp), %rax
andb $-0x21, 0x8(%rax)
jmp 0x8b5e
movq -0x30(%rbp), %rax
orb $0x2, 0x9(%rax)
movq $-0x1, %r13
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/qq-smart[P]qq_sh_server/core/qq_time.c
// Function: qq_time_update
void
qq_time_update(void)
{
    u_char          *p;
    struct tm        t;
    time_t           sec;
    qq_uint_t        msec;
    struct timeval   tv;

    gettimeofday(&tv, NULL);

    sec = tv.tv_sec;
    msec = tv.tv_usec / 1000;

    qq_current_msec = (qq_msec_t) sec * 1000 + msec;
#if (QQ_HAVE_TIMESTAMP_JSON_PKG)
    sprintf(qq_timestamp_json_pkg, "{\"timestamp\":%lu}", qq_current_msec);
    qq_timestamp_json_pkg_size = strlen(qq_timestamp_json_pkg) + 1;
#endif


    qq_localtime(sec, &t);

    p = cached_err_log_time;
    (void) sprintf(p, "%4d/%02d/%02d_%02d:%02d:%02d",
                   t.tm_year, t.tm_mon,
                   t.tm_mday, t.tm_hour,
                   t.tm_min,  t.tm_sec);

    qq_cached_err_log_time.data = p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
leaq -0x28(%rbp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x22c0
movq (%rbx), %r14
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x8(%rbx)
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rdx
addq %rax, %rdx
imulq $0x3e8, %r14, %rax      # imm = 0x3E8
addq %rdx, %rax
movq %rax, 0x6af2(%rip)      # 0xf6c0
movq 0x6aeb(%rip), %rdx      # 0xf6c0
leaq 0x69d4(%rip), %rbx      # 0xf5b0
leaq 0x24f2(%rip), %rsi      # 0xb0d5
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2070
movq %rbx, %rdi
callq 0x20d0
incq %rax
movq %rax, 0x6ac9(%rip)      # 0xf6c8
leaq -0x18(%rbp), %rdi
movq %r14, (%rdi)
callq 0x21b0
movl (%rax), %r10d
movl 0x4(%rax), %r11d
movl 0x8(%rax), %r9d
movl 0xc(%rax), %r8d
movl 0x10(%rax), %ecx
incl %ecx
movl $0x76c, %edx            # imm = 0x76C
addl 0x14(%rax), %edx
leaq 0x6aa2(%rip), %rbx      # 0xf6d0
leaq 0x24b2(%rip), %rsi      # 0xb0e7
movq %rbx, %rdi
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x2070
addq $0x10, %rsp
movq %rbx, 0x6a6a(%rip)      # 0xf6b8
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/qq-smart[P]qq_sh_server/core/qq_time.c
// Function: qq_localtime
void
qq_localtime(time_t s, struct tm *tp)
{
    struct tm  *t;

    t = localtime(&s);
    *tp = *t;

    tp->tm_mon++;
    tp->tm_year += 1900;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq -0x10(%rbp), %rax
movq %rdi, (%rax)
movq %rax, %rdi
callq 0x21b0
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
movups %xmm2, 0x20(%rbx)
movq 0x30(%rax), %rax
movq %rax, 0x30(%rbx)
incl 0x10(%rbx)
addl $0x76c, 0x14(%rbx)      # imm = 0x76C
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/qq-smart[P]qq_sh_server/os/qq_udp_recv.c
// Function: qq_udp_recv
ssize_t
qq_udp_recv(qq_connection_t *c, u_char *buf, size_t size)
{
    ssize_t       n;
    qq_err_t      err;
    qq_event_t   *rev;

    rev = c->read;

    do {
        n = recv(c->fd, buf, size, 0);

        qq_log_debug("recv: fd:%d %d of %d", c->fd, n, size);

        if (n >= 0) {
            return n;
        }

        err = errno;

        if (err == QQ_EAGAIN || err == QQ_EINTR) {
            qq_log_debug("recv() not ready");
            n = QQ_AGAIN;
        } else {
            n = QQ_ERROR;
            break;
        }
    } while (err == QQ_EINTR);

    rev->ready = 0;

    if (n == QQ_ERROR) {
        rev->error = 1;
    }
	
    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movq 0x8(%rdi), %rax
movq %rax, -0x30(%rbp)
movl 0x18(%r12), %edi
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x20b0
movq %rax, %r15
movl 0x18(%r12), %esi
leaq 0x2424(%rip), %rdi      # 0xb104
movq %rax, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x6daa
testq %r15, %r15
jns 0x8d51
callq 0x2030
movl (%rax), %r13d
cmpl $0xb, %r13d
je 0x8d06
cmpl $0x4, %r13d
jne 0x8d23
leaq 0x2367(%rip), %rdi      # 0xb074
xorl %eax, %eax
callq 0x6daa
cmpl $0x4, %r13d
je 0x8cbf
movq $-0x2, %r15
jmp 0x8d2a
movq $-0x1, %r15
movq -0x30(%rbp), %rdx
movl 0x8(%rdx), %eax
movl %eax, %ecx
andl $-0x21, %ecx
cmpl $0x4, %r13d
je 0x8d4e
cmpl $0xb, %r13d
je 0x8d4e
andl $0xfffffddf, %eax       # imm = 0xFFFFFDDF
orl $0x200, %eax            # imm = 0x200
movl %eax, %ecx
movl %ecx, 0x8(%rdx)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/qq-smart[P]qq_sh_server/os/qq_udp_send.c
// Function: qq_udp_send
ssize_t
qq_udp_send(qq_connection_t *c, u_char *buf, size_t size)
{
    ssize_t       n;
    qq_err_t      err;
    qq_event_t   *wev;

    wev = c->write;

    for ( ;; ) {
        n = sendto(c->fd, buf, size, 0, c->sockaddr, c->socklen);

        qq_log_debug("sendto: fd:%d %d of %d to \"%s\"",
                     c->fd, n, size, c->addr_text);

        if (n >= 0) {
            if ((size_t) n != size) {
                wev->error = 1;
                return QQ_ERROR;
            }
            return n;
        }

        err = errno;

        if (err == QQ_EAGAIN) {
            wev->ready = 0;
            qq_log_debug("sendto() not ready");
            return QQ_AGAIN;
        }

        if (err != QQ_EINTR) {
            wev->error = 1;
            return QQ_ERROR;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x10(%rdi), %rax
movq %rax, -0x30(%rbp)
leaq 0x238f(%rip), %r12      # 0xb119
movl 0x18(%r15), %edi
movq 0x50(%r15), %r8
movl 0x58(%r15), %r9d
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x2040
movq %rax, %r13
movl 0x18(%r15), %esi
movq 0x60(%r15), %r8
movq %r12, %rdi
movq %rax, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x6daa
testq %r13, %r13
jns 0x8df3
callq 0x2030
movl (%rax), %eax
cmpl $0x4, %eax
je 0x8d8a
cmpl $0xb, %eax
jne 0x8df8
movq -0x30(%rbp), %rax
andb $-0x21, 0x8(%rax)
leaq 0x2355(%rip), %rdi      # 0xb138
xorl %eax, %eax
callq 0x6daa
movq $-0x2, %r13
jmp 0x8e07
cmpq %rbx, %r13
je 0x8e07
movq -0x30(%rbp), %rax
orb $0x2, 0x9(%rax)
movq $-0x1, %r13
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/qq-smart[P]qq_sh_server/app/qq_video_audio_device.c
// Function: qq_video_audio_device_init
qq_int_t
qq_video_audio_device_init(qq_cycle_t *cycle)
{
    if (qq_add_listening_config(SOCK_DGRAM,
        QQ_VIDEO_AUDIO_DEVICE_UDP_LISTENING_PORT,
        QQ_VIDEO_AUDIO_DEVICE_UDP_LISTENING_POOL_SIZE,
        qq_video_audio_device_process_request_handler) == QQ_ERROR)
    {
        qq_log_error(0, "qq_video_audio_device_init()->qq_add_listening_config() failed");
        return QQ_ERROR;
    }

    return QQ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x37(%rip), %rcx        # 0x8e5e
movl $0x200, %edx            # imm = 0x200
movl $0x2, %edi
movl $0x32c8, %esi           # imm = 0x32C8
callq 0x659c
cmpq $-0x1, %rax
je 0x8e45
xorl %eax, %eax
jmp 0x8e5c
leaq 0x22ff(%rip), %rsi      # 0xb14b
xorl %edi, %edi
xorl %eax, %eax
callq 0x6c5d
movq $-0x1, %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/qq-smart[P]qq_sh_server/app/qq_wifi_device.c
// Function: qq_wifi_device_init
qq_int_t
qq_wifi_device_init(qq_cycle_t *cycle)
{
    if (qq_add_listening_config(SOCK_STREAM,
        QQ_WIFI_DEVICE_TCP_LISTENING_PORT,
        QQ_WIFI_DEVICE_TCP_LISTENING_POOL_SIZE,
        qq_wifi_device_init_connection_handler) == QQ_ERROR)
    {
        qq_log_error(0, "qq_wifi_device_init()->qq_add_listening_config() failed");
        return QQ_ERROR;
    }

    qq_rbtree_init(&qq_wifi_device_rbtree, &qq_wifi_device_sentinel,
                    qq_wifi_device_rbtree_insert_value);

    qq_wifi_device_md5_id_str_pos = strlen(QQ_WIFI_DEVICE_MD5_CORE_STR);
    memcpy(qq_wifi_device_md5_str, QQ_WIFI_DEVICE_MD5_CORE_STR, strlen(QQ_WIFI_DEVICE_MD5_CORE_STR));

    return QQ_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x87(%rip), %rcx        # 0x8f42
movl $0x200, %edx            # imm = 0x200
movl $0x1, %edi
movl $0x2ee0, %esi           # imm = 0x2EE0
callq 0x659c
cmpq $-0x1, %rax
je 0x8f29
movb $0x0, 0x6834(%rip)      # 0xf710
leaq 0x680d(%rip), %rax      # 0xf6f0
movq %rax, 0x682e(%rip)      # 0xf718
movq %rax, 0x682f(%rip)      # 0xf720
leaq 0xe3(%rip), %rax        # 0x8fdb
movq %rax, 0x6829(%rip)      # 0xf728
movb $0x1, 0x682a(%rip)      # 0xf730
movups 0x2323(%rip), %xmm0     # 0xb230
movaps %xmm0, 0x682c(%rip)     # 0xf740
movabsq $0x65696b766d353833, %rax # imm = 0x65696B766D353833
movq %rax, 0x6828(%rip)      # 0xf74d
xorl %eax, %eax
jmp 0x8f40
leaq 0x22c8(%rip), %rsi      # 0xb1f8
xorl %edi, %edi
xorl %eax, %eax
callq 0x6c5d
movq $-0x1, %rax
popq %rbp
retq