LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/teodorst[P]app-huffman/huffman.c
// Function: read_configuration_pthreads
char **read_configuration_pthreads(FILE *codification_fp, unsigned long long int *nbits_buffer, int* input_buffer_contors, size_t *size) {
    char **codification = (char**) calloc(128, sizeof(char*));
    char *line = NULL;
    ssize_t nread;
    char index;
    int i;
    size_t line_length;
    int codification_length;

    // read number of lines from codification
    fscanf(codification_fp, "%d", &codification_length);
    fgetc(codification_fp);

    // read codification
    for(i = 0; i < codification_length; i ++ ) {
        nread = getline(&line, &line_length, codification_fp);
        if (nread == 1) {
            index = line[0];
            nread = getline(&line, &line_length, codification_fp);
            if (nread != -1) {
                line[nread-1] = '\0';
                codification[(unsigned char)index] = strdup(line+3);
            }
        } else {
            line[nread-1] = '\0';
            sscanf(line, "%c", &index);
            codification[(unsigned char)index] = strdup(line+4);
        }
    }

    int threads_no = 0;
    // read number of threads and bits
    fscanf(codification_fp, "%d\n%lu\n", &threads_no, size);

    for (i = 0; i < threads_no; i ++) {
        fscanf(codification_fp, "%llu %d", nbits_buffer + i, input_buffer_contors + i);
    }

    free(line);
    return codification;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, 0x28(%rsp)
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movl $0x80, %edi
movl $0x8, %esi
callq 0x10e0
movq %rax, 0x20(%rsp)
movq $0x0, 0x10(%rsp)
leaq 0xf26(%rip), %rsi       # 0x3102
leaq 0x1c(%rsp), %r13
movq %r12, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x1050
movq %r12, %rdi
callq 0x10c0
cmpl $0x0, (%r13)
jle 0x229d
leaq 0x10(%rsp), %rbp
leaq 0x30(%rsp), %r13
xorl %r15d, %r15d
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x1170
movq 0x10(%rsp), %rcx
cmpq $0x1, %rax
jne 0x2256
movb (%rcx), %al
movb %al, 0xf(%rsp)
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x1170
cmpq $-0x1, %rax
je 0x228f
movq 0x10(%rsp), %rcx
movb $0x0, -0x1(%rcx,%rax)
movq 0x10(%rsp), %rdi
addq $0x3, %rdi
jmp 0x227c
movb $0x0, -0x1(%rcx,%rax)
movq 0x10(%rsp), %rdi
leaq 0xe8e(%rip), %rsi       # 0x30f5
leaq 0xf(%rsp), %rdx
xorl %eax, %eax
callq 0x1130
movq 0x10(%rsp), %rdi
addq $0x4, %rdi
callq 0x11b0
movzbl 0xf(%rsp), %ecx
movq 0x20(%rsp), %rdx
movq %rax, (%rdx,%rcx,8)
incl %r15d
cmpl 0x1c(%rsp), %r15d
jl 0x220e
leaq 0x18(%rsp), %r13
movl $0x0, (%r13)
leaq 0xe2a(%rip), %rsi       # 0x30db
movq %r12, %rdi
movq %r13, %rdx
movq 0x28(%rsp), %rcx
xorl %eax, %eax
callq 0x1050
cmpl $0x0, (%r13)
jle 0x22fc
leaq 0xe2c(%rip), %r13       # 0x30fd
xorl %r15d, %r15d
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1050
incq %r15
movslq 0x18(%rsp), %rax
addq $0x4, %rbx
addq $0x8, %r14
cmpq %rax, %r15
jl 0x22d4
movq 0x10(%rsp), %rdi
callq 0x1030
movq 0x20(%rsp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/teodorst[P]app-huffman/huffman.c
// Function: find_codification
void find_codification(node_t *node, char *path, int level, char **codification) {
    if (node->left != NULL){
        path[level] = 48;
        find_codification(node->left, path, level + 1, codification);
    }

    if (node->right != NULL){
        path[level] = 49;
        find_codification(node->right, path, level + 1, codification);
    }

    /* if a leaf is found */
    if (!(node->left) && !(node->right)){
        path[level] = '\0';
        codification[(unsigned char)node->data] = strdup(path);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rsi, %r15
movq %rdi, %r14
cmpq $0x0, 0x8(%rdi)
movslq %edx, %r12
je 0x234e
movb $0x30, (%r15,%r12)
movq 0x8(%r14), %rdi
leal 0x1(%r12), %edx
movq %r15, %rsi
movq %rbx, %rcx
callq 0x231a
cmpq $0x0, 0x10(%r14)
je 0x236e
movb $0x31, (%r15,%r12)
movq 0x10(%r14), %rdi
leal 0x1(%r12), %edx
movq %r15, %rsi
movq %rbx, %rcx
callq 0x231a
cmpq $0x0, 0x8(%r14)
jne 0x2392
cmpq $0x0, 0x10(%r14)
jne 0x2392
movb $0x0, (%r15,%r12)
movq %r15, %rdi
callq 0x11b0
movzbl 0x4(%r14), %ecx
movq %rax, (%rbx,%rcx,8)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/teodorst[P]app-huffman/huffman.c
// Function: print_codes
void print_codes(node_t *root, char *path, int level) {
    if (root->left != NULL){
        path[level] = 48;
        print_codes(root->left, path, level + 1);
    }

    if (root->right != NULL){
        path[level] = 49;
        print_codes(root->right, path, level + 1);
    }

    /* if a leaf is found */
    if (!(root->left) && !(root->right)){
        path[level] = '\0';
        /* print the codification for letter */
        printf("%c : %s\n", root->data, path);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpq $0x0, 0x8(%rdi)
movslq %edx, %r15
je 0x23c8
movb $0x30, (%rbx,%r15)
movq 0x8(%r14), %rdi
leal 0x1(%r15), %edx
movq %rbx, %rsi
callq 0x239e
cmpq $0x0, 0x10(%r14)
je 0x23e4
movb $0x31, (%rbx,%r15)
movq 0x10(%r14), %rdi
leal 0x1(%r15), %edx
movq %rbx, %rsi
callq 0x239e
cmpq $0x0, 0x8(%r14)
jne 0x23f2
cmpq $0x0, 0x10(%r14)
je 0x23f8
popq %rbx
popq %r14
popq %r15
retq
movb $0x0, (%rbx,%r15)
movsbl 0x4(%r14), %esi
leaq 0xce3(%rip), %rdi       # 0x30ec
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x10a0
// File: /workspace/github_c_makefile_star2_O3/teodorst[P]app-huffman/huffman.c
// Function: build_huffman_tree_from_codification
node_t* build_huffman_tree_from_codification(char **codification) {
    int i;
    int current_code_index = 0;
    int codification_length;

    // init the root node
    node_t* root = init_node('#');
    node_t* node = root;

    for (i = 0; i < 128; i ++) {
        if (codification[i]) {
            node = root;
            codification_length = strlen(codification[i]);
            current_code_index = 0;
            for (current_code_index = 0; current_code_index < codification_length; current_code_index ++) {
                if (codification[i][current_code_index] == '0') {
                    if (node->left == NULL) {
                        node->left = init_node('#');
                    }
                    node = node->left;
                }
                else {
                    if (node->right == NULL) {
                        node->right = init_node('#');
                    }
                    node = node->right;
                }
            }
            node->data = i;
        }
    }
    return root;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x18, %edi
callq 0x1120
movq %rax, %r14
movb $0x23, 0x4(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
xorl %r12d, %r12d
movq (%rbx,%r12,8), %rdi
testq %rdi, %rdi
je 0x24b6
callq 0x1090
movq %rax, %r15
movq %r14, %rax
testl %r15d, %r15d
jle 0x24b2
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
xorl %r13d, %r13d
movq %r14, %rbp
movq (%rbx,%r12,8), %rax
cmpb $0x30, (%rax,%r13)
jne 0x2481
movq 0x8(%rbp), %rax
testq %rax, %rax
jne 0x24a7
addq $0x8, %rbp
jmp 0x248e
movq 0x10(%rbp), %rax
testq %rax, %rax
jne 0x24a7
addq $0x10, %rbp
movl $0x18, %edi
callq 0x1120
movb $0x23, 0x4(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %rax, (%rbp)
incq %r13
movq %rax, %rbp
cmpq %r13, %r15
jne 0x2467
movb %r12b, 0x4(%rax)
incq %r12
cmpq $0x80, %r12
jne 0x2441
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/teodorst[P]app-huffman/huffman.c
// Function: build_huffman_tree
node_t* build_huffman_tree(unsigned long long int* frequecy){
    /* initialize and populate the priority queue */
    heap_t *h = init_priority_queue();
    insert_values_in_queue(frequecy, h);

    while (h->len > 1) {
        node_t* root = (struct node_t*) malloc (sizeof(struct node_t));
        node_t* left;
        node_t* right;

        /* extract two nodes from heap to form their root node */
        left = pop(h);
        right = pop(h);
        /* populate the root node */
        root->priority = left->priority + right->priority;
        root->data = '#';
        root->left = left;
        root->right = right;

        /* insert root node into the heap */
        push(h, root);
    }

    /* return the only node left in heap */
    return pop(h);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
xorl %eax, %eax
callq 0x1684
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
callq 0x17c4
cmpl $0x2, 0x8(%rbx)
jl 0x2541
movl $0x18, %edi
callq 0x1120
movq %rax, %r14
movq %rbx, %rdi
callq 0x1718
movq %rax, %r15
movq %rbx, %rdi
callq 0x1718
movl (%rax), %ecx
addl (%r15), %ecx
movl %ecx, (%r14)
movb $0x23, 0x4(%r14)
movq %r15, 0x8(%r14)
movq %rax, 0x10(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1693
cmpl $0x1, 0x8(%rbx)
jg 0x24fb
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1718
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: accpt_error_cb(evconnlistener*, void*)
static void accpt_error_cb(struct evconnlistener *listener, void *ctx)
{
    struct event_base *base = evconnlistener_get_base(listener);
    int err = EVUTIL_SOCKET_ERROR();
    ctx =(void *)ctx;//(消除警告)
    fprintf(stderr, "Got an error %d (%s) the listener."
            "Shuttinf sown.\r\n",err, evutil_socket_error_to_string(err));
    event_base_loopexit(base, NULL);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
callq 0x3200
movq %rax, %rbx
callq 0x3070
movl (%rax), %ebp
movq 0xd6e9(%rip), %rax      # 0x10fd8
movq (%rax), %r14
movl %ebp, %edi
callq 0x3170
leaq 0x9413(%rip), %rsi      # 0xcd13
movq %r14, %rdi
movl %ebp, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x35e0
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x3330
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/ev_websocket.c
// Function: base64_encode(unsigned char const*, char*, int)
int base64_encode( const unsigned char *bindata, char *base64, int binlength)
{
    int i, j;
    unsigned char current;
    for ( i = 0, j = 0 ; i < binlength ; i += 3 )
    {
        current = (bindata[i] >> 2) ;
        current &= (unsigned char)0x3F;
        base64[j++] = base64char[(int)current];
        current = ( (unsigned char)(bindata[i] << 4 ) ) & ( (unsigned char)0x30 ) ;
        if ( i + 1 >= binlength )
        {
            base64[j++] = base64char[(int)current];
            base64[j++] = '=';
            base64[j++] = '=';
            break;
        }
        current |= ( (unsigned char)(bindata[i+1] >> 4) ) & ( (unsigned char) 0x0F );
        base64[j++] = base64char[(int)current];
        current = ( (unsigned char)(bindata[i+1] << 2) ) & ( (unsigned char)0x3C ) ;
        if ( i + 2 >= binlength )
        {
            base64[j++] = base64char[(int)current];
            base64[j++] = '=';
            break;
        }
        current |= ( (unsigned char)(bindata[i+2] >> 6) ) & ( (unsigned char) 0x03 );
        base64[j++] = base64char[(int)current];
        current = ( (unsigned char)bindata[i+2] ) & ( (unsigned char)0x3F ) ;
        base64[j++] = base64char[(int)current];
    }
    base64[j] = '\0';
    return j;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testl %edx, %edx
jle 0x4477
movl %edx, %ecx
movl $0x1, %r9d
xorl %eax, %eax
leaq 0x6c41(%rip), %r8       # 0xb020
movzbl -0x1(%rdi,%r9), %r10d
shrl $0x2, %r10d
movb (%r10,%r8), %r10b
movb %r10b, (%rsi,%rax)
movzbl -0x1(%rdi,%r9), %r10d
shll $0x4, %r10d
andl $0x30, %r10d
cmpq %rcx, %r9
jae 0x447b
movzbl (%rdi,%r9), %r11d
shrl $0x4, %r11d
movzbl %r10b, %r10d
orq %r11, %r10
movb (%r10,%r8), %r10b
movb %r10b, 0x1(%rsi,%rax)
movzbl (%rdi,%r9), %r10d
shll $0x2, %r10d
andl $0x3c, %r10d
leal 0x1(%r9), %r11d
cmpl %edx, %r11d
jge 0x4499
movzbl 0x1(%rdi,%r9), %r11d
shrl $0x6, %r11d
movzbl %r10b, %r10d
orq %r11, %r10
movb (%r10,%r8), %r10b
movb %r10b, 0x2(%rsi,%rax)
movzbl 0x1(%rdi,%r9), %r10d
andl $0x3f, %r10d
movb (%r10,%r8), %r10b
movb %r10b, 0x3(%rsi,%rax)
addq $0x4, %rax
addq $0x3, %r9
leal -0x1(%r9), %r10d
cmpl %edx, %r10d
jl 0x43df
jmp 0x44b3
xorl %eax, %eax
jmp 0x44b3
movb (%r10,%r8), %cl
leal 0x1(%rax), %edx
andl $-0x3, %edx
movb %cl, (%rsi,%rdx)
movl %eax, %ecx
andl $-0x4, %ecx
movw $0x3d3d, 0x2(%rsi,%rcx) # imm = 0x3D3D
addl $0x4, %eax
jmp 0x44b3
movb (%r10,%r8), %cl
leal 0x2(%rax), %edx
andl $-0x2, %edx
movb %cl, (%rsi,%rdx)
leal 0x4(%rax), %ecx
andl $-0x4, %eax
movb $0x3d, 0x3(%rsi,%rax)
movl %ecx, %eax
cltq
movb $0x0, (%rsi,%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/ev_websocket.c
// Function: base64_decode(char const*, unsigned char*)
int base64_decode( const char *base64, unsigned char *bindata)
{
    int i, j;
    unsigned char k;
    unsigned char temp[4];
    for ( i = 0, j = 0; base64[i] != '\0' ; i += 4 )
    {
        memset( temp, 0xFF, sizeof(temp) );
        for ( k = 0 ; k < 64 ; k ++ )
        {
            if ( base64char[k] == base64[i] )
                temp[0]= k;
        }
        for ( k = 0 ; k < 64 ; k ++ )
        {
            if ( base64char[k] == base64[i+1] )
                temp[1]= k;
        }
        for ( k = 0 ; k < 64 ; k ++ )
        {
            if ( base64char[k] == base64[i+2] )
                temp[2]= k;
        }
        for ( k = 0 ; k < 64 ; k ++ )
        {
            if ( base64char[k] == base64[i+3] )
                temp[3]= k;
        }
        bindata[j++] = ((unsigned char)(((unsigned char)(temp[0] << 2))&0xFC)) | \
                       ((unsigned char)((unsigned char)(temp[1]>>4)&0x03));
        if ( base64[i+2] == '=' )
            break;
        bindata[j++] = ((unsigned char)(((unsigned char)(temp[1] << 4))&0xF0)) | \
                       ((unsigned char)((unsigned char)(temp[2]>>2)&0x0F));
        if ( base64[i+3] == '=' )
            break;
        bindata[j++] = ((unsigned char)(((unsigned char)(temp[2] << 6))&0xF0)) | \
                       ((unsigned char)(temp[3]&0x3F));
    }
    return j;
}

// Assembly:
movb (%rdi), %r10b
testb %r10b, %r10b
je 0x45d1
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
xorl %ecx, %ecx
leaq 0x6b43(%rip), %r8       # 0xb020
xorl %edx, %edx
xorl %eax, %eax
movb $-0x1, %r9b
xorl %r11d, %r11d
cmpb %r10b, (%r11,%r8)
movzbl %r9b, %r9d
cmovel %r11d, %r9d
incq %r11
cmpq $0x40, %r11
jne 0x44e7
movb 0x1(%rdi,%rcx), %r11b
movb $-0x1, %r10b
xorl %ebx, %ebx
cmpb %r11b, (%rbx,%r8)
movzbl %r10b, %r10d
cmovel %ebx, %r10d
incq %rbx
cmpq $0x40, %rbx
jne 0x4506
movq %rcx, %rbx
orq $0x2, %rbx
movb 0x2(%rdi,%rcx), %r14b
movb $-0x1, %r11b
xorl %r15d, %r15d
cmpb %r14b, (%r15,%r8)
movzbl %r11b, %r11d
cmovel %r15d, %r11d
incq %r15
cmpq $0x40, %r15
jne 0x452d
movq %rcx, %r15
orq $0x3, %r15
movb 0x3(%rdi,%rcx), %r12b
movb $-0x1, %r14b
xorl %r13d, %r13d
cmpb %r12b, (%r13,%r8)
movzbl %r14b, %r14d
cmovel %r13d, %r14d
incq %r13
cmpq $0x40, %r13
jne 0x4554
shlb $0x2, %r9b
movl %r10d, %r12d
shrb $0x4, %r12b
andb $0x3, %r12b
orb %r9b, %r12b
movb %r12b, (%rsi,%rdx)
cmpb $0x3d, (%rdi,%rbx)
je 0x45d4
shlb $0x4, %r10b
movl %r11d, %r9d
shrb $0x2, %r9b
andb $0xf, %r9b
orb %r10b, %r9b
movb %r9b, 0x1(%rsi,%rdx)
cmpb $0x3d, (%rdi,%r15)
je 0x45d8
shlb $0x6, %r11b
andb $0x3f, %r14b
orb %r11b, %r14b
addl $0x3, %eax
movb %r14b, 0x2(%rsi,%rdx)
addq $0x3, %rdx
movb 0x4(%rdi,%rcx), %r10b
addq $0x4, %rcx
testb %r10b, %r10b
jne 0x44e1
movl %edx, %eax
jmp 0x45db
xorl %eax, %eax
retq
incl %eax
jmp 0x45db
addl $0x2, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/ev_websocket.c
// Function: webSocket_getRandomString(unsigned char*, unsigned int)
void webSocket_getRandomString(unsigned char *buf, unsigned int len)
{
    unsigned int i;
    unsigned char temp;
    srand((int)time(0));
    for(i = 0; i < len; i++)
    {
        temp = (unsigned char)(rand()%256);
        if(temp == 0)   // 随机数不要0, 0 会干扰对字符串长度的判断
            temp = 128;
        buf[i] = temp;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
xorl %edi, %edi
callq 0x33d0
movl %eax, %edi
callq 0x3400
testl %r14d, %r14d
je 0x462d
movl %r14d, %r14d
xorl %r15d, %r15d
movl $0x80, %r12d
callq 0x3120
testb %al, %al
cmovel %r12d, %eax
movb %al, (%rbx,%r15)
incq %r15
cmpq %r15, %r14
jne 0x4616
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/ev_websocket.c
// Function: webSocket_buildRespondShakeKey(unsigned char*, unsigned int, unsigned char*)
int webSocket_buildRespondShakeKey(unsigned char *acceptKey, unsigned int acceptKeyLen, unsigned char *respondKey)
{
    char *clientKey;  
    char *sha1Data;  
    int  n;  
    const char GUID[] = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";  
    unsigned int GUIDLEN;

    if(acceptKey == NULL)  
        return 0;  
    GUIDLEN = sizeof(GUID);
    clientKey = (char *)calloc(1, sizeof(char)*(acceptKeyLen + GUIDLEN + 10));  
    memset(clientKey, 0, (acceptKeyLen + GUIDLEN + 10));
    //
    memcpy(clientKey, acceptKey, acceptKeyLen); 
    memcpy(&clientKey[acceptKeyLen], GUID, GUIDLEN);
    clientKey[acceptKeyLen + GUIDLEN] = '\0';
    //
    sha1Data = sha1_hash(clientKey);  
    n = strlen(sha1Data);  
    //


    n = base64_encode((const unsigned char *)sha1Data, (char *)respondKey, n);
    //
    free(sha1Data);
    free(clientKey);
    return n;
}

// Assembly:
testq %rdi, %rdi
je 0x472d
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %r12d
movq %rdi, %r15
leal 0x25(%r12), %r13d
leal 0x2f(%r12), %esi
movl $0x1, %edi
callq 0x32b0
movq %rax, %r14
movl %r12d, %r12d
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3350
movabsq $0x31314235384344, %rax # imm = 0x31314235384344
movq %rax, 0x1d(%r14,%r12)
movaps 0x699d(%rip), %xmm0     # 0xb070
movups %xmm0, (%r14,%r12)
movaps 0x69a1(%rip), %xmm0     # 0xb080
movups %xmm0, 0x10(%r14,%r12)
movb $0x0, (%r14,%r13)
movq %r14, %rdi
callq 0x438c
movq %rax, %r15
movq %rax, %rdi
callq 0x31f0
movq %r15, %rdi
movq %rbx, %rsi
movl %eax, %edx
callq 0x43c2
movl %eax, %ebx
movq %r15, %rdi
callq 0x3500
movq %r14, %rdi
callq 0x3500
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/ev_websocket.c
// Function: webSocket_matchShakeKey(unsigned char*, unsigned int, unsigned char*, unsigned int)
int webSocket_matchShakeKey(unsigned char *myKey, unsigned int myKeyLen, unsigned char *acceptKey, unsigned int acceptKeyLen)
{
    unsigned int retLen;
    unsigned char tempKey[256] = {0};
    //
    retLen = webSocket_buildRespondShakeKey(myKey, myKeyLen, tempKey);
    //printf("webSocket_matchShakeKey :\r\n%d : %s\r\n%d : %s\r\n", acceptKeyLen, acceptKey, retLen, tempKey);
    //
    if(retLen != acceptKeyLen)
    {
        De_printf("webSocket_matchShakeKey : len err\r\n%s\r\n%s\r\n%s\r\n", myKey, tempKey, acceptKey);
        return -1;
    }
    else if(strcmp((const char *)tempKey, (const char *)acceptKey) != 0)
    {
        De_printf("webSocket_matchShakeKey : str err\r\n%s\r\n%s\r\n", tempKey, acceptKey);
        return -1;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movl %ecx, %r12d
movq %rdx, -0x30(%rbp)
movl %esi, %r13d
movq %rdi, %r14
leaq -0x130(%rbp), %rbx
xorl %r15d, %r15d
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3250
movq %r14, %rdi
movl %r13d, %esi
movq %rbx, %rdx
callq 0x4675
cmpl %r12d, %eax
jne 0x47d3
leaq -0x130(%rbp), %rdi
movq -0x30(%rbp), %rbx
movq %rbx, %rsi
callq 0x35c0
testl %eax, %eax
je 0x4822
leaq 0x6a0c(%rip), %rdi      # 0xb1ab
leaq 0x6a10(%rip), %rsi      # 0xb1b6
leaq 0x6a21(%rip), %rdx      # 0xb1ce
movl $0x21c, %ecx            # imm = 0x21C
xorl %eax, %eax
callq 0x3080
leaq 0x6a4d(%rip), %rdi      # 0xb20d
leaq -0x130(%rbp), %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3080
jmp 0x4810
leaq 0x69d1(%rip), %rdi      # 0xb1ab
leaq 0x69d5(%rip), %rsi      # 0xb1b6
leaq 0x69e6(%rip), %rdx      # 0xb1ce
movl $0x217, %ecx            # imm = 0x217
xorl %eax, %eax
callq 0x3080
leaq 0x69e2(%rip), %rdi      # 0xb1dd
leaq -0x130(%rbp), %rdx
movq %r14, %rsi
movq -0x30(%rbp), %rcx
xorl %eax, %eax
callq 0x3080
leaq 0x6cc7(%rip), %rdi      # 0xb4de
callq 0x3680
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl %r15d, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/ev_websocket.c
// Function: ev_webSocket_serverLinkToClient(bufferevent*, char*, unsigned int)
int ev_webSocket_serverLinkToClient(struct bufferevent * client, char *recvBuf, unsigned int bufLen)
{
    char *p;
    int ret;
    char recvShakeKey[512], respondPackage[1024];
    if(bufLen==0)
        return -1;
    if((p = strstr(recvBuf, "Sec-WebSocket-Key: ")) == NULL)
        return -1;
    p += strlen("Sec-WebSocket-Key: ");
    //
    memset(recvShakeKey, 0, sizeof(recvShakeKey));
    sscanf(p, "%s", recvShakeKey);      // 取得握手key
    ret = strlen(recvShakeKey);
    if(ret < 1)
        return -1;
    //
    memset(respondPackage, 0, sizeof(respondPackage));
    webSocket_buildHttpRespond((unsigned char*)recvShakeKey,(unsigned int)ret, ( char *)respondPackage);
    //
    return bufferevent_write(client,respondPackage, strlen(respondPackage));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x600, %rsp            # imm = 0x600
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testl %edx, %edx
je 0x532a
movq %rdi, %rbx
leaq 0x61c2(%rip), %rax      # 0xb456
movq %rsi, %rdi
movq %rax, %rsi
callq 0x3100
testq %rax, %rax
je 0x532a
movq %rax, %r15
addq $0x13, %r15
leaq -0x220(%rbp), %r12
movl $0x200, %edx            # imm = 0x200
movq %r12, %rdi
xorl %esi, %esi
callq 0x3250
leaq 0x6032(%rip), %rsi      # 0xb2fe
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3410
movq %r12, %rdi
callq 0x31f0
movq %rax, %r15
testl %r15d, %r15d
jle 0x532a
leaq -0x620(%rbp), %r14
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
xorl %esi, %esi
callq 0x3250
leaq -0x220(%rbp), %rdi
movl %r15d, %esi
movq %r14, %rdx
callq 0x4858
movq %r14, %rdi
callq 0x31f0
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x3260
movl %eax, %r14d
movl %r14d, %eax
addq $0x600, %rsp            # imm = 0x600
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/ev_websocket.c
// Function: ev_webSocket_send(bufferevent*, unsigned char*, unsigned int, bool, Websocket_CommunicationType)
int ev_webSocket_send(struct bufferevent * bufferev, unsigned char *data, unsigned int dataLen, bool mod, Websocket_CommunicationType type)
{
    unsigned char *webSocketPackage;
    unsigned int retLen, ret;
    /* unsigned int i; */

    /* printf("webSocket_send : %d\r\n", dataLen); */
    //---------- websocket数据打包 ----------
    webSocketPackage = (unsigned char *)calloc(1, sizeof(char)*(dataLen + 128));  memset(webSocketPackage, 0, (dataLen + 128));
    retLen = webSocket_enPackage(data, dataLen, webSocketPackage, (dataLen + 128), mod, type);
    
       /* printf("webSocket_send : %d\r\n" , retLen); */
       /* for(i = 0; i < retLen; i ++)  printf("%.2X ", webSocketPackage[i]); */
       /* printf("\r\n"); */
    ret = bufferevent_write(bufferev, webSocketPackage, retLen); 
    free(webSocketPackage);
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, -0x2c(%rbp)
movl %ecx, %r14d
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, -0x38(%rbp)
leal 0x80(%r15), %r13d
movl $0x1, %edi
movq %r13, %rsi
callq 0x32b0
movq %rax, %rbx
movq %r12, %rdi
movl %r15d, %esi
movq %rax, %rdx
movl %r13d, %ecx
movl %r14d, %r8d
movl -0x2c(%rbp), %r9d
callq 0x4903
movl %eax, %edx
movq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x3260
movl %eax, %r14d
movq %rbx, %rdi
callq 0x3500
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: webSocke_thread_cb(void*)
void *webSocke_thread_cb(void * arg)
{
    if(arg != NULL)
    {
        WebddSocket_Thread_Cb_arg_t * cb_arg = (WebddSocket_Thread_Cb_arg_t *)arg;
        switch(cb_arg->type)
        {
        case Ws_Cb_Type_connect:
            if(cb_arg->client->httpServer->ws_connect_cb != NULL)
                cb_arg->client->httpServer->ws_connect_cb(cb_arg->client);
            break;
        case Ws_Cb_Type_disconnect:
            if(cb_arg->client->httpServer->ws_disconnect_cb != NULL)
                cb_arg->client->httpServer->ws_disconnect_cb(cb_arg->client);
            break;
        case Ws_Cb_Type_write:
            if(cb_arg->client->httpServer->ws_weite_cb != NULL)
                cb_arg->client->httpServer->ws_weite_cb(cb_arg->client);
            break;
        case Ws_Cb_Type_read:
            if(cb_arg->client->httpServer->ws_read_cb != NULL)
                cb_arg->client->httpServer->ws_read_cb(cb_arg->client);
            break;
        }
        free(arg);
    }
    return NULL;
}

// Assembly:
testq %rdi, %rdi
je 0x643b
pushq %rbx
movq %rdi, %rbx
movl 0x8(%rdi), %eax
cmpq $0x3, %rax
ja 0x6432
leaq 0x515c(%rip), %rcx      # 0xb540
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rbx), %rdi
movq 0x28(%rdi), %rax
movq 0x90(%rax), %rax
jmp 0x642b
movq (%rbx), %rdi
movq 0x28(%rdi), %rax
movq 0xa0(%rax), %rax
jmp 0x642b
movq (%rbx), %rdi
movq 0x28(%rdi), %rax
movq 0xa8(%rax), %rax
jmp 0x642b
movq (%rbx), %rdi
movq 0x28(%rdi), %rax
movq 0x98(%rax), %rax
testq %rax, %rax
je 0x6432
callq *%rax
movq %rbx, %rdi
callq 0x3500
popq %rbx
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: http_request_free(http_request_t*)
int http_request_free(struct http_request_t *request)
{
    if(request == NULL)
        return -1;
    if(request->method != NULL)
        free(request->method);
    if(request->request_data != NULL)
        free(request->request_data);
    if(request->url != NULL)
        free(request->url);
    if(request->http_version != NULL)
        free(request->http_version);
    if(request->HeadParameter != NULL)
        delete request->HeadParameter;
    memset(request, 0, sizeof(http_request_t));

    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x6ae3
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x6a7b
callq 0x3500
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x6a89
callq 0x3500
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x6a97
callq 0x3500
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x6aa5
callq 0x3500
movq 0x20(%rbx), %r14
testq %r14, %r14
je 0x6ac3
movq %r14, %rdi
callq 0x7e7e
movl $0x30, %esi
movq %r14, %rdi
callq 0x3460
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
movq $0x0, 0x30(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: http_resqonse_free(http_resqonse_t*)
int http_resqonse_free(struct http_resqonse_t *resqonse)
{
    if(resqonse == NULL)
        return -1;
    if(resqonse->resqonse_data != NULL)
        free(resqonse->resqonse_data);
    if(resqonse->HeadParameter != NULL)
        delete resqonse->HeadParameter;
    memset(resqonse, 0, sizeof(http_resqonse_t));
    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x6fc6
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x6f94
callq 0x3500
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x6fb2
movq %r14, %rdi
callq 0x7e7e
movl $0x30, %esi
movq %r14, %rdi
callq 0x3460
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: http_supervise_thread(void*)
void *http_supervise_thread(void * arg)
{
    httpServer_t *httpServer=(httpServer_t *)arg;
    pthread_mutex_lock(&httpServer->lock);
    while(!httpServer->shutdown)
    {
        pthread_mutex_unlock(&httpServer->lock);
        usleep(1000*HTTPSERVER_SUPERVISE_TIME);
        pthread_mutex_lock(&httpServer->lock);
        pthread_mutex_lock(&httpServer->clientMap_lock);
        for(BufferevMap::iterator i = httpServer->clientMap->begin();
            i != httpServer->clientMap->end();)
        {
            struct timeval date;
            gettimeofday(&date, NULL);
            pthread_mutex_lock(&i->second->lock);
            if(((i->second->stat == HTTP_CONNECTED) 
              ||(i->second->stat == HTTP_IDLE)
              ||(i->second->stat == HTTP_DISCONNECTED))
              &&(date.tv_sec - (i->second)->final_optime.tv_sec) > HTTPSERVER_IDLE_TIMEROUT)
            {
                pthread_mutex_unlock(&i->second->lock);
                httpChilent_Close_nolock((i++)->second);
            }
            else
            {
                pthread_mutex_unlock(&i->second->lock);
                i++;
            }
        }
        pthread_mutex_unlock(&httpServer->clientMap_lock);
    }
    pthread_mutex_unlock(&httpServer->lock);
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0x3620
cmpl $0x0, 0x84(%rbx)
jne 0x7275
leaq 0x28(%rbx), %r14
leaq 0x8(%rsp), %r15
leaq 0xa290(%rip), %rbp      # 0x1144c
movq %rbx, %rdi
callq 0x3310
leaq 0xa27d(%rip), %rax      # 0x11448
imull $0x3e8, (%rax), %edi    # imm = 0x3E8
callq 0x35d0
movq %rbx, %rdi
callq 0x3620
movq %r14, %rdi
callq 0x3620
movq 0x50(%rbx), %rax
movq 0x18(%rax), %r12
addq $0x8, %rax
cmpq %rax, %r12
je 0x7260
movq %r15, %rdi
xorl %esi, %esi
callq 0x3690
movq 0x28(%r12), %rdi
callq 0x3620
movq 0x28(%r12), %rdi
cmpl $0x2, 0x38(%rdi)
ja 0x724a
movq 0x8(%rsp), %rax
subq 0xb8(%rdi), %rax
movslq (%rbp), %rcx
cmpq %rcx, %rax
jle 0x724a
callq 0x3310
movq %r12, %rdi
callq 0x32c0
movq %rax, %r13
movq 0x28(%r12), %rdi
callq 0x728e
movq %r13, %r12
jmp 0x725a
callq 0x3310
movq %r12, %rdi
callq 0x32c0
movq %rax, %r12
movq 0x50(%rbx), %rax
jmp 0x71ee
movq %r14, %rdi
callq 0x3310
cmpl $0x0, 0x84(%rbx)
je 0x71bc
movq %rbx, %rdi
callq 0x3310
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: httpChilent_free(httpChilent_t*)
int httpChilent_free(struct httpChilent_t* client)
{
    if(client == NULL)
        return-1;
    pthread_mutex_lock(&client->lock);
    if(client->receive_evbuff != NULL)
    {
        evbuffer_lock(client->receive_evbuff);
        evbuffer_free(client->receive_evbuff);
    }
    http_request_free(&client->request);
    http_resqonse_free(&client->resqonse);
    pthread_mutex_destroy(&client->lock);
    free(client);
    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x7439
pushq %rbx
movq %rdi, %rbx
callq 0x3620
movq 0x98(%rbx), %rdi
testq %rdi, %rdi
je 0x7413
callq 0x32d0
movq 0x98(%rbx), %rdi
callq 0x31a0
leaq 0x40(%rbx), %rdi
callq 0x6a62
leaq 0x78(%rbx), %rdi
callq 0x6f7a
movq %rbx, %rdi
callq 0x34e0
movq %rbx, %rdi
callq 0x3500
xorl %eax, %eax
popq %rbx
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: httpServer_setHttpHandler(httpServer_t*, void (*)(httpChilent_t*))
int httpServer_setHttpHandler(httpServer_t *httpServer, httpd_handler_t handler)
{
    if(httpServer == NULL)
        return -1;
    pthread_mutex_lock(&httpServer->lock);
    httpServer->handler = handler;
    pthread_mutex_unlock(&httpServer->lock);
    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x76ce
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x3620
movq %r14, 0x88(%rbx)
movq %rbx, %rdi
callq 0x3310
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: httpServer_setWebSocket_read_cb(httpServer_t*, void (*)(httpChilent_t*), char const*)
int httpServer_setWebSocket_read_cb(httpServer_t * httpServer, webSocket_cb_t ws_read_cb,const char * url)
{
    if(httpServer == NULL)
        return -1;
    pthread_mutex_lock(&httpServer->lock);
    httpServer->webSocket_url = (char *)malloc(strlen(url)); 
    if(httpServer->webSocket_url == NULL)
    {
        return -1;
    }
    httpServer->ws_read_cb = ws_read_cb;
    strcpy(httpServer->webSocket_url, url);
    pthread_mutex_unlock(&httpServer->lock);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x77bc
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
callq 0x3620
movq %r14, %rdi
callq 0x31f0
movq %rax, %rdi
callq 0x35a0
movq %rax, 0xb0(%rbx)
testq %rax, %rax
je 0x77bc
movq %r15, 0x90(%rbx)
movq %rax, %rdi
movq %r14, %rsi
callq 0x33e0
movq %rbx, %rdi
callq 0x3310
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: httpServer_free(httpServer_t*)
int httpServer_free(httpServer_t * httpServer)
{
    if(httpServer == NULL)
        return -1;
    httpServer->shutdown = true;
    if(httpServer->http_supervise_thread != 0)
        pthread_join(httpServer->http_supervise_thread, NULL);
    if(httpServer->http_listeber)
    {
        evconnlistener_free(httpServer->http_listeber);
    }
    if(httpServer->evb_thpool)
    {
        evbase_threadpool_destroy(httpServer->evb_thpool);
    }
    pthread_mutex_lock(&httpServer->clientMap_lock);
    if(httpServer->clientMap)
    {
        BufferevMap:: iterator i;
        for(i=httpServer->clientMap->begin();i != httpServer->clientMap->end(); i++)
        {
            httpChilent_free(i->second);
        }
        delete httpServer->clientMap;

    }
    pthread_mutex_destroy(&httpServer->lock);
    pthread_mutex_destroy(&httpServer->clientMap_lock);
    if(httpServer)
    {
        free(httpServer);
    }
    return 0;

}

// Assembly:
testq %rdi, %rdi
je 0x7866
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, 0x84(%rdi)
movq 0x78(%rdi), %rdi
testq %rdi, %rdi
je 0x77f7
xorl %esi, %esi
callq 0x33b0
movq 0x68(%rbx), %rdi
testq %rdi, %rdi
je 0x7805
callq 0x30e0
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x7813
callq 0x87ab
leaq 0x28(%rbx), %r14
movq %r14, %rdi
callq 0x3620
movq 0x50(%rbx), %r15
testq %r15, %r15
je 0x787c
movq 0x18(%r15), %r12
leaq 0x8(%r15), %rax
cmpq %rax, %r12
je 0x785c
movq 0x28(%r12), %rdi
callq 0x73e8
movq %r12, %rdi
callq 0x32c0
movq %rax, %r12
movq 0x50(%rbx), %r15
leaq 0x8(%r15), %rax
cmpq %rax, %r12
jne 0x7835
testq %r15, %r15
je 0x786c
movq %r15, %rdi
callq 0x7f10
jmp 0x786f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
xorl %r15d, %r15d
movl $0x30, %esi
movq %r15, %rdi
callq 0x3460
movq %rbx, %rdi
callq 0x34e0
movq %r14, %rdi
callq 0x34e0
movq %rbx, %rdi
callq 0x3500
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: bufferev_read_cb(bufferevent*, void*)
static void bufferev_read_cb(struct bufferevent *bev,void *ctx)
{
    bev = (struct bufferevent *)bev;
    struct httpChilent_t *client = (struct httpChilent_t *)ctx;
    pthread_mutex_lock(&client->lock);
    if(client->stat == HTTP_WS_DATA )
    {
        if(client->httpServer->ws_read_cb != NULL)
            threadpool_add(client->httpServer->pool, ws_read_cb_thread, client);
        pthread_mutex_unlock(&client->lock);
    }
    else
    {
        client->stat = HTTP_REQUEST;
        if(client->httpServer->handler != NULL)
            threadpool_add(client->httpServer->pool, httpd_handler_thread, client);
        pthread_mutex_unlock(&client->lock);
    }
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
movq %rsi, %rdi
callq 0x3620
cmpl $0x5, 0x38(%rbx)
jne 0x7c8d
movq 0x28(%rbx), %rax
cmpq $0x0, 0x90(%rax)
je 0x7cb5
leaq -0xcbf(%rip), %rsi      # 0x6fcc
jmp 0x7ca9
movl $0x3, 0x38(%rbx)
movq 0x28(%rbx), %rax
cmpq $0x0, 0x88(%rax)
je 0x7cb5
leaq -0x11c0(%rip), %rsi     # 0x6ae9
movq 0x70(%rax), %rdi
movq %rbx, %rdx
callq 0x9179
movq %rbx, %rdi
popq %rbx
jmp 0x3310
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/ev_httpd.cpp
// Function: bufferev_write_cb(bufferevent*, void*)
static void bufferev_write_cb(struct bufferevent *bev,void *ctx)
{
    bev = (struct bufferevent *)bev;
    httpChilent_t *client = (httpChilent_t *)ctx;
    pthread_mutex_lock(&client->lock);
    gettimeofday(&client->final_optime,NULL);
    if( client->stat != HTTP_WS_DATA)
        client->stat = HTTP_IDLE;
    if(client->stat == HTTP_WS_DATA)
    {
        WebddSocket_Thread_Cb_arg_t * cb_arg = (WebddSocket_Thread_Cb_arg_t *)malloc(sizeof(WebddSocket_Thread_Cb_arg_t));
        cb_arg->client = client;
        cb_arg->type = Ws_Cb_Type_write;
        threadpool_add(evbase_threadpool_get_threadpool(client->httpServer->evb_thpool), webSocke_thread_cb, cb_arg);
    }
    pthread_mutex_unlock(&client->lock);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rsi, %rdi
callq 0x3620
leaq 0xb8(%rbx), %rdi
xorl %esi, %esi
callq 0x3690
cmpl $0x5, 0x38(%rbx)
jne 0x7d19
movl $0x10, %edi
callq 0x35a0
movq %rax, %r14
movq %rbx, (%rax)
movl $0x1, 0x8(%rax)
movq 0x28(%rbx), %rax
movq 0x60(%rax), %rdi
callq 0x855c
leaq -0x1941(%rip), %rsi     # 0x63cb
movq %rax, %rdi
movq %r14, %rdx
callq 0x9179
jmp 0x7d20
movl $0x2, 0x38(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3310
nop
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/evbase_threadpool.cpp
// Function: manager_thread(void*)
void *manager_thread(void *evbase_threadpool)
{
    evbase_threadpool_t *evb_thpool = (evbase_threadpool_t*)evbase_threadpool; 
    while(!evb_thpool->shutdown)
    {
        usleep(BASE_MANAGER_TIMER*1000);        
        pthread_mutex_lock(&evb_thpool->evbase_thread_list.lock);
        for(evbase_thread_vector::iterator i = evb_thpool->evbase_thread_list.list->begin();
            i != evb_thpool->evbase_thread_list.list->end(); )
        {
            pthread_mutex_lock(&(*i)->monitor_num_locl);    
            if((*i)->monitor_num == 0 && evb_thpool->evbase_thread_list.list->size() > 1){
                if(!event_base_loopbreak((*i)->base))
                {
                    event_base_dispatch((*i)->base);
                    pthread_mutex_destroy(&(*i)->monitor_num_locl);
                    evb_thpool->evbase_thread_list.list->erase(i);
                    free(*i);
                }
                else
                {
                    pthread_mutex_unlock(&(*i)->monitor_num_locl);    
                    i++;
                }
            }
            else
            {
                pthread_mutex_unlock(&(*i)->monitor_num_locl);    
                i++;
            }
        }
        pthread_mutex_unlock(&evb_thpool->evbase_thread_list.lock);
    }
    return NULL;
}

// Assembly:
cmpl $0x0, 0x40(%rdi)
jne 0x877e
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
leaq 0x8d73(%rip), %r12      # 0x1142c
imull $0x3e8, (%r12), %edi    # imm = 0x3E8
callq 0x35d0
movq %r14, %rdi
callq 0x3620
movq 0x30(%rbx), %rax
movq (%rax), %r15
cmpq 0x8(%rax), %r15
je 0x8763
movq (%r15), %rdi
callq 0x3620
movq (%r15), %rdi
cmpl $0x0, 0x30(%rdi)
jne 0x8711
movq 0x30(%rbx), %rax
movq 0x8(%rax), %rcx
subq (%rax), %rcx
cmpq $0x9, %rcx
jb 0x8711
movq 0x28(%rdi), %rdi
callq 0x3590
movq (%r15), %rdi
testl %eax, %eax
je 0x8720
callq 0x3310
addq $0x8, %r15
movq 0x30(%rbx), %rax
jmp 0x86d5
movq 0x28(%rdi), %rdi
callq 0x3640
movq (%r15), %rdi
callq 0x34e0
movq 0x30(%rbx), %r13
leaq 0x8(%r15), %rsi
movq 0x8(%r13), %rdx
cmpq %rdx, %rsi
je 0x8751
subq %rsi, %rdx
movq %r15, %rdi
callq 0x36a0
movq 0x8(%r13), %rdx
addq $-0x8, %rdx
movq %rdx, 0x8(%r13)
movq (%r15), %rdi
callq 0x3500
jmp 0x871a
movq %r14, %rdi
callq 0x3310
cmpl $0x0, 0x40(%rbx)
je 0x86b9
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/evbase_threadpool.cpp
// Function: evbase_thread(void*)
void *evbase_thread(void *arg)
{
    struct evbase_thread_arg * evb_th_arg = (struct evbase_thread_arg *)arg;    
    //evbase_threadpool_t *evb_thpool = evb_th_arg->evb_thpool;
    struct event_base *base = evb_th_arg->base;
    //回收内存
    free(arg);
    
    event_reinit(base);

    while(event_base_dispatch(base)==1);
    event_base_free(base);
    return NULL;
}

// Assembly:
pushq %rbx
movq (%rdi), %rbx
callq 0x3500
movq %rbx, %rdi
callq 0x3720
movq %rbx, %rdi
callq 0x3640
cmpl $0x1, %eax
je 0x8792
movq %rbx, %rdi
callq 0x35b0
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/evbase_threadpool.cpp
// Function: evbase_threadpool_destroy(evbase_threadpool_t*)
void evbase_threadpool_destroy(evbase_threadpool_t * evb_thpool)
{
    if(evb_thpool == NULL)
        return;
    pthread_mutex_lock(&evb_thpool->evbase_thread_list.lock);
    pthread_mutex_destroy(&evb_thpool->evbase_thread_list.lock);
    evb_thpool->shutdown = true;
    if(evb_thpool->manager != 0)
    {
        pthread_join(evb_thpool->manager, NULL);
    }
    if(evb_thpool->pool != NULL)
    {
        threadpool_destroy(evb_thpool->pool);
    }
    evbase_threadpool_free(evb_thpool);
}

// Assembly:
testq %rdi, %rdi
je 0x87fe
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq %r14, %rdi
callq 0x3620
movq %r14, %rdi
callq 0x34e0
movl $0x1, 0x40(%rbx)
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x87e2
xorl %esi, %esi
callq 0x33b0
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x87ef
callq 0x90f9
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x87ff
retq
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/evbase_threadpool.cpp
// Function: evbase_threadpool_free(evbase_threadpool_t*)
void evbase_threadpool_free(evbase_threadpool_t * evb_thpool)
{
    if(evb_thpool == NULL)
        return;
    if(evb_thpool->evbase_thread_list.list != NULL)
    {
        for(evbase_thread_vector::iterator i = evb_thpool->evbase_thread_list.list->begin();
            i != evb_thpool->evbase_thread_list.list->end();i++ )
        {
            if((*i)->base != NULL)
                event_base_free((*i)->base);

            pthread_mutex_lock(&(*i)->monitor_num_locl);    
            pthread_mutex_destroy(&(*i)->monitor_num_locl);    
            free(*i);
        }
        delete evb_thpool->evbase_thread_list.list;
    }
    free(evb_thpool);
}

// Assembly:
testq %rdi, %rdi
je 0x888d
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %r15
testq %r15, %r15
je 0x8880
movq (%r15), %r14
cmpq 0x8(%r15), %r14
je 0x885f
movq (%r14), %rdi
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x8839
movq %rax, %rdi
callq 0x35b0
movq (%r14), %rdi
callq 0x3620
movq (%r14), %rdi
callq 0x34e0
movq (%r14), %rdi
callq 0x3500
addq $0x8, %r14
movq 0x30(%rbx), %r15
cmpq 0x8(%r15), %r14
jne 0x8822
movq (%r15), %r14
testq %r14, %r14
je 0x8873
movq 0x10(%r15), %rsi
subq %r14, %rsi
movq %r14, %rdi
callq 0x3460
movl $0x18, %esi
movq %r15, %rdi
callq 0x3460
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x3500
retq
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/evbase_threadpool.cpp
// Function: evbase_threadpool_close_event(evbase_threadpool_t*, event_base*)
void evbase_threadpool_close_event(evbase_threadpool_t *evb_thpool ,event_base * base)
{

    for(evbase_thread_vector::iterator i = evb_thpool->evbase_thread_list.list->begin();
        i != evb_thpool->evbase_thread_list.list->end(); i++)
    {
        if((*i)->base == base)
        {
            if((*i)->monitor_num >0)
                (*i)->monitor_num--;
            else
                De_fprintf(stderr, "base监听数为0时发生了 coles_event\r\n");
        }
    }           

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x30(%rdi), %rax
movq (%rax), %r12
cmpq 0x8(%rax), %r12
je 0x8a42
movq %rsi, %rbx
movq %rdi, %r14
addq $0x30, %r14
movq %rsp, %r15
movq (%r12), %rcx
cmpq %rbx, 0x28(%rcx)
jne 0x8a25
movl 0x30(%rcx), %edx
testl %edx, %edx
je 0x8a31
decl %edx
movl %edx, 0x30(%rcx)
addq $0x8, %r12
cmpq 0x8(%rax), %r12
jne 0x8a0f
jmp 0x8a42
movq %r14, %rdi
movq %r15, %rsi
callq 0x3f3a
movq (%rsp), %rax
jmp 0x8a25
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/sszllzss[P]webSocket_Libevent_ThreadPool/Threadpool.cpp
// Function: threadpool_destroy(threadpool_t*)
int threadpool_destroy(threadpool_t *pool)
{
    int i;
    if (pool == NULL) {
        return -1;

    }
    pool->shutdown = true;

    /*先销毁管理线程*/
    pthread_join(pool->adjust_tid, NULL);
    int pive_thr_num = pool->threads->size();
    for (i = 0; i < pive_thr_num; i++) {
        /*通知所有的空闲线程*/
        pthread_cond_broadcast(&(pool->queue_not_empty));

    }
    for(pthread_list_t::iterator i=pool->threads->begin(); i != pool->threads->end(); i++)
    {
        pthread_join(*(i), NULL);
    }
    threadpool_free(pool);


    return 0;

}

// Assembly:
testq %rdi, %rdi
je 0x9173
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x1, 0xd4(%rdi)
movq 0xb0(%rdi), %rdi
xorl %esi, %esi
callq 0x33b0
movq 0xb8(%rbx), %rax
movl 0x10(%rax), %ebp
testl %ebp, %ebp
jle 0x9145
leaq 0x80(%rbx), %r14
movq %r14, %rdi
callq 0x3180
decl %ebp
jne 0x9132
movq 0xb8(%rbx), %rax
movq (%rax), %r14
cmpq %rax, %r14
je 0x9164
movq 0x10(%r14), %rdi
xorl %esi, %esi
callq 0x33b0
movq (%r14), %r14
cmpq 0xb8(%rbx), %r14
jne 0x914d
movq %rbx, %rdi
callq 0x9268
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq