LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/hash_table/hash_table.c
// Function: ht_init
void *ht_init(int max_cnt)
{
    ht_t *p = NULL;
    int len = max_cnt * sizeof(ht_item_t);

    if (max_cnt <= 0) {
        return NULL;
    }

    p = malloc(sizeof(ht_t));
    if (NULL == p) {
        return NULL;
    }
    memset(p, 0, sizeof(ht_t));

    p->item = malloc(len);
    if (NULL == p->item) {
        free(p);
        return NULL;
    }
    memset(p->item, 0, len);
    pthread_mutex_init(&p->locker , NULL);

    p->cnt = max_cnt;
    return p;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
testl %edi, %edi
jle 0x3a6b
movl %edi, %ebp
pushq $0x1
popq %rdi
pushq $0x38
popq %rsi
callq 0x24a0
testq %rax, %rax
je 0x3a6b
movq %rax, %rbx
movl %ebp, %eax
shll $0x5, %eax
movslq %eax, %rsi
pushq $0x1
popq %rdi
callq 0x24a0
movq %rax, 0x30(%rbx)
testq %rax, %rax
je 0x3a63
movq %rbx, %rdi
addq $0x8, %rdi
xorl %esi, %esi
callq 0x21d0
movl %ebp, (%rbx)
jmp 0x3a6d
movq %rbx, %rdi
callq 0x2250
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/hash_table/hash_table.c
// Function: ht_find_lockless
void *ht_find_lockless(void *ht, const void *key, unsigned int key_len, void *val, int *size_val)
{
    ht_item_t *p = _ht_find_lockless(ht, key, key_len);
    void *ret = NULL;

    while (p) {
        if (p->key && !memcmp(p->key, key, key_len)) {
            ret = p->val;
            break;
        }
        p = p->next;
    }

    if (ret && val && size_val) {
        memcpy(val, ret, p->size_val > *size_val ? *size_val : p->size_val);
        *size_val = p->size_val;
    }

    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r13
callq 0x3b1e
movq %rax, %r15
movl %ebp, %ebp
xorl %r12d, %r12d
testq %r15, %r15
je 0x3ade
movq (%r15), %rdi
testq %rdi, %rdi
je 0x3ad4
movq %r13, %rsi
movq %rbp, %rdx
callq 0x2350
testl %eax, %eax
je 0x3ada
movq 0x18(%r15), %r15
jmp 0x3ab8
movq 0x8(%r15), %r12
testq %rbx, %rbx
je 0x3b0c
testq %r14, %r14
je 0x3b0c
testq %r12, %r12
je 0x3b0c
movl 0x10(%r15), %eax
movl (%rbx), %ecx
cmpl %ecx, %eax
cmovll %eax, %ecx
movslq %ecx, %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x2580
movl 0x10(%r15), %eax
movl %eax, (%rbx)
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/hash_table/hash_table.c
// Function: ht_find_lockless
static ht_item_t *_ht_find_lockless(void *ht, const void *key, unsigned int key_len)
{
    unsigned int pos = 0;
    ht_t *pt = (ht_t *)ht;

    if (!ht || !key || key_len <= 0) {
        return NULL;
    }

    pos = _hash_func((const unsigned char *)key, key_len) % pt->cnt;

    return (pt->item + pos);//users should check the pointer to get all the values.
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
testl %edx, %edx
sete %r8b
xorl %eax, %eax
orb %cl, %r8b
jne 0x3b7d
movl %edx, %ecx
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x3b5f
movzbl (%rsi,%rdx), %r8d
incq %rdx
addl %r8d, %eax
imull $0x401, %eax, %r8d      # imm = 0x401
movl %r8d, %eax
shrl $0x6, %eax
xorl %r8d, %eax
jmp 0x3b3d
leal (%rax,%rax,8), %eax
movl %eax, %ecx
shrl $0xb, %ecx
xorl %eax, %ecx
imull $0x8001, %ecx, %eax     # imm = 0x8001
xorl %edx, %edx
divl (%rdi)
movl %edx, %eax
shlq $0x5, %rax
addq 0x30(%rdi), %rax
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/hash_table/hash_table.c
// Function: ht_find
void *ht_find(void *ht, const void *key, unsigned int key_len, void *val, int *size_val)
{
    void *ret = NULL;

    ht_lock(ht);
    ret = ht_find_lockless(ht, key, key_len, val, size_val);
    ht_unlock(ht);
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r8, %rbx
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r12
callq 0x3a77
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x3a95
movq %rax, %rbx
movq %r12, %rdi
callq 0x3a86
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/hash_table/hash_table.c
// Function: ht_add
int ht_add(void *ht, const void *key, unsigned int len_key, const void *val, unsigned int size_val)
{
    int ret = 0;
    ht_lock(ht);
    ret = ht_add_lockless(ht, key, len_key, val, size_val);
    ht_unlock(ht);

    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %ebx
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r12
callq 0x3a77
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movq %r14, %rcx
movl %ebx, %r8d
callq 0x3bc3
movl %eax, %ebx
movq %r12, %rdi
callq 0x3a86
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/hash_table/hash_table.c
// Function: ht_del_node
static int _ht_del_node(void *ht_item, const void *key, unsigned int len_key)
{
    ht_item_t *p_tmp = NULL;
    ht_item_t *next = NULL;
    ht_item_t *parent = NULL; // the root node or previous node
    int flag = 0;
    int ret = -1;

    if (!ht_item) {
        return ret;
    }

    parent = (ht_item_t *)ht_item;
    while (parent) {
        if (parent->key && parent->val &&
                (!key || !memcmp(parent->key, key, len_key))) {
            next = parent->next;//store its next item befroe free.

            free(parent->key);
            parent->key = NULL;
            free(parent->val);
            parent->val = NULL;
            ret = 0;
            if (1 == flag) {//just free the added item not the root item.
                free(parent);
                p_tmp->next = next;
            } else {
                p_tmp = parent;
            }

            if (key) {
                break;
            }
            parent = next;
        } else {
            p_tmp = parent;
            parent = parent->next;
        }
        flag = 1;
    }

    return ret;
}

// Assembly:
testq %rdi, %rdi
je 0x3ea6
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edx, %r14d
pushq $-0x1
popq %rax
xorl %ebp, %ebp
xorl %r12d, %r12d
movl %eax, (%rsp)
movq %rdi, %r15
testq %r15, %r15
je 0x3e94
movq (%r15), %r13
testq %r13, %r13
je 0x3e37
cmpq $0x0, 0x8(%r15)
je 0x3e37
testq %rbx, %rbx
je 0x3e43
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2350
testl %eax, %eax
je 0x3e43
movq %r15, %rbp
movq 0x18(%r15), %r15
movb $0x1, %r12b
jmp 0x3e08
movq 0x18(%r15), %rax
movq %rax, (%rsp)
movq %r13, %rdi
callq 0x2250
andq $0x0, (%r15)
movq 0x8(%r15), %rdi
callq 0x2250
andq $0x0, 0x8(%r15)
testb $0x1, %r12b
je 0x3e7d
movq %r15, %rdi
callq 0x2250
movq (%rsp), %rdi
movq %rdi, 0x18(%rbp)
jmp 0x3e84
movq %r15, %rbp
movq (%rsp), %rdi
xorl %eax, %eax
movb $0x1, %r12b
testq %rbx, %rbx
je 0x3e02
jmp 0x3e97
movl (%rsp), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/hash_table/hash_table.c
// Function: ht_del
int ht_del(void *ht, const void *key, unsigned int len_key)
{
    int ret = 0;
    ht_lock(ht);
    ret = ht_del_lockless(ht, key, len_key);
    ht_unlock(ht);

    return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
callq 0x3a77
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x3dc1
movl %eax, %ebx
movq %r15, %rdi
callq 0x3a86
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/hash_table/hash_table.c
// Function: ht_iterator_lockless
void *ht_iterator_lockless(void *ht, iter_func func, void *usr)
{
    int i = 0;
    ht_t *pt = ht;
    ht_item_t *item = NULL;

    if (!pt || !func) {
        return NULL;
    }

    for (i = 0; i < pt->cnt; i++) {
        item = pt->item + i;

        while (item) {
            if (!item->key || !item->val) {
                item = item->next;
            } else {
                if(0 == func(item->key, item->val, usr))
                    return item->key;
                else
                    item = item->next;
            }
        }
    }

    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x3f45
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebx, %ebx
xorl %r13d, %r13d
movslq (%r12), %rax
cmpq %rax, %r13
jge 0x3f4d
movq %r13, %rbp
shlq $0x5, %rbp
addq 0x30(%r12), %rbp
testq %rbp, %rbp
je 0x3f40
movq (%rbp), %rdi
testq %rdi, %rdi
je 0x3f3a
movq 0x8(%rbp), %rsi
testq %rsi, %rsi
je 0x3f3a
movq %r14, %rdx
callq *%r15
testl %eax, %eax
je 0x3f49
movq 0x18(%rbp), %rbp
jmp 0x3f19
incq %r13
jmp 0x3f04
xorl %ebx, %ebx
jmp 0x3f4d
movq (%rbp), %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/hash_table/hash_table.c
// Function: ht_clear_lockless
int ht_clear_lockless(void *ht)
{
    ht_t *pt = ht;
    int i = 0;
    if (!ht) {
        return -1;
    }

    for (i = 0; i < pt->cnt; i++) {
        _ht_del_node(pt->item + i, NULL, 0);
    }

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x3f98
movq %rdi, %r14
xorl %ebx, %ebx
xorl %r15d, %r15d
xorl %r12d, %r12d
movslq (%r14), %rax
cmpq %rax, %r12
jge 0x3f9b
movq 0x30(%r14), %rdi
addq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3de0
incq %r12
addq $0x20, %r15
jmp 0x3f77
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/hash_table/hash_table.c
// Function: ht_clear
int ht_clear(void *ht)
{
    int ret = 0;
    ht_lock(ht);
    ret = ht_clear_lockless(ht);
    ht_unlock(ht);

    return ret;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x3a77
movq %rbx, %rdi
callq 0x3f5f
movl %eax, %ebp
movq %rbx, %rdi
callq 0x3a86
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/hash_table/hash_table.c
// Function: ht_destroy
int ht_destroy(void *ht)
{
    ht_t *pt = (ht_t *)ht;
    if (!pt) {
        return -1;
    }

    ht_lock(pt);

    ht_clear_lockless(pt);
    free(pt->item);

    ht_unlock(pt);

    pthread_mutex_destroy(&pt->locker);
    free(pt);

    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x401a
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq %r14, %rdi
callq 0x2510
movq %rbx, %rdi
callq 0x3f5f
movq 0x30(%rbx), %rdi
callq 0x2250
movq %r14, %rdi
callq 0x2570
movq %r14, %rdi
callq 0x2540
movq %rbx, %rdi
callq 0x2250
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $-0x1
popq %rax
retq
nop
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/log/simple_log.c
// Function: log_print
void log_print(LOG_LEVEL lvl, cchar *color, cchar *f, int l, cchar *fmt, ...)
{
    if(lvl < g_log_lvl)
        return;

    va_list ap;
    va_start(ap, fmt);

    char *tmp = NULL;
    char buf_date[20] = {0};
    time_t cur_time = time(NULL);

    f = !f ? "\b" : f;

    tmp = strrchr(f, '/');
    if(tmp)
        f = tmp + 1;

    //add color support
    if (color) 
        printf("%s", color);
    
    printf(LOG_FMT,get_timestamp(buf_date, 20, cur_time), g_log_desc[lvl], f, l);

    vprintf(fmt, ap);

    if (color) 
        printf("%s\n", COL_DEF);

    va_end(ap);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
testb %al, %al
je 0x4094
movaps %xmm0, 0x80(%rsp)
movaps %xmm1, 0x90(%rsp)
movaps %xmm2, 0xa0(%rsp)
movaps %xmm3, 0xb0(%rsp)
movaps %xmm4, 0xc0(%rsp)
movaps %xmm5, 0xd0(%rsp)
movaps %xmm6, 0xe0(%rsp)
movaps %xmm7, 0xf0(%rsp)
movq %r9, 0x78(%rsp)
cmpl %edi, 0x82b1(%rip)      # 0xc350
ja 0x41c2
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r12
movl %edi, %r14d
movq %r8, 0x8(%rsp)
leaq 0x50(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x140(%rsp), %rax
movq %rax, 0x18(%rsp)
movabsq $0x3000000028, %rax     # imm = 0x3000000028
movq %rax, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
andl $0x0, 0x40(%rsp)
xorl %edi, %edi
callq 0x25c0
movq %rax, %r13
testq %r15, %r15
leaq 0x4338(%rip), %rbx      # 0x8434
cmovneq %r15, %rbx
pushq $0x2f
popq %rsi
movq %rbx, %rdi
callq 0x22f0
leaq 0x1(%rax), %r15
testq %rax, %rax
cmoveq %rbx, %r15
testq %r12, %r12
je 0x417e
leaq 0x4cdd(%rip), %rdi      # 0x8dff
movq %r12, %rsi
xorl %eax, %eax
callq 0x2080
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x41d4
movl %r14d, %eax
leaq 0x7c4a(%rip), %rcx      # 0xbd90
movq (%rcx,%rax,8), %rdx
leaq 0x42e5(%rip), %rdi      # 0x8436
movq %rbx, %rsi
movq %r15, %rcx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x2080
leaq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x2360
leaq 0x42cf(%rip), %rdi      # 0x8446
callq 0x20d0
jmp 0x41c2
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x41d4
movl %r14d, %eax
leaq 0x7bf8(%rip), %rcx      # 0xbd90
movq (%rcx,%rax,8), %rdx
leaq 0x4293(%rip), %rdi      # 0x8436
movq %rbx, %rsi
movq %r15, %rcx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x2080
leaq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x2360
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/log/simple_log.c
// Function: get_timestamp
static char *get_timestamp(char *buf, int len, time_t cur_time)
{
    struct tm tm_time;

    localtime_r(&cur_time, &tm_time);

    snprintf(buf, len, "%d-%d-%d %d:%d:%d",
             1900 + tm_time.tm_year, 1 + tm_time.tm_mon,
             tm_time.tm_mday, tm_time.tm_hour,
             tm_time.tm_min, tm_time.tm_sec);
    return buf;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
movq %rsi, (%rdi)
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x24d0
movl $0x76c, %ecx            # imm = 0x76C
addl 0x14(%r14), %ecx
movl 0x10(%r14), %r8d
incl %r8d
movl 0xc(%r14), %r9d
movl 0x8(%r14), %r10d
movl (%r14), %r11d
movl 0x4(%r14), %r14d
subq $0x8, %rsp
leaq 0x422e(%rip), %rdx      # 0x844b
pushq $0x14
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
pushq %r11
pushq %r14
pushq %r10
callq 0x20b0
addq $0x20, %rsp
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/sha256/sha256.c
// Function: sha256_hash
void
sha256_hash(unsigned char *buf, const unsigned char *data, size_t size)
{
  sha256_t hash;
  sha256_init(&hash);
  sha256_update(&hash, data, size);
  sha256_final(&hash, buf);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movaps 0x409c(%rip), %xmm0     # 0x84e0
movq %rsp, %r14
movaps %xmm0, (%r14)
movaps 0x409e(%rip), %xmm0     # 0x84f0
movaps %xmm0, 0x10(%r14)
andq $0x0, 0x20(%r14)
movq %r14, %rdi
callq 0x4477
movq %r14, %rdi
movq %rbx, %rsi
callq 0x44c7
addq $0x68, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/sha256/sha256.c
// Function: sha256_update
void
sha256_update(sha256_t *p, const unsigned char *data, size_t size)
{
  uint32_t curBufferPos = (uint32_t)p->count & 0x3F;
  while (size > 0)
  {
    p->buffer[curBufferPos++] = *data++;
    p->count++;
    size--;
    if (curBufferPos == 64)
    {
      curBufferPos = 0;
      sha256_write_byte_block(p);
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0x20(%rdi), %eax
andl $0x3f, %eax
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0x44bb
movb (%r14,%r12), %cl
movl %eax, %edx
incl %eax
movb %cl, 0x28(%r15,%rdx)
incq 0x20(%r15)
cmpl $0x40, %eax
jne 0x44b6
movq %r15, %rdi
callq 0x4569
xorl %eax, %eax
incq %r12
jmp 0x4491
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/utility/sha256/sha256.c
// Function: sha256_final
void
sha256_final(sha256_t *p, unsigned char *digest)
{
  uint64_t lenInBits = (p->count << 3);
  uint32_t curBufferPos = (uint32_t)p->count & 0x3F;
  unsigned i;
  p->buffer[curBufferPos++] = 0x80;
  while (curBufferPos != (64 - 8))
  {
    curBufferPos &= 0x3F;
    if (curBufferPos == 0)
      sha256_write_byte_block(p);
    p->buffer[curBufferPos++] = 0;
  }
  for (i = 0; i < 8; i++)
  {
    p->buffer[curBufferPos++] = (unsigned char)(lenInBits >> 56);
    lenInBits <<= 8;
  }
  sha256_write_byte_block(p);

  for (i = 0; i < 8; i++)
  {
    *digest++ = (unsigned char)(p->state[i] >> 24);
    *digest++ = (unsigned char)(p->state[i] >> 16);
    *digest++ = (unsigned char)(p->state[i] >> 8);
    *digest++ = (unsigned char)(p->state[i]);
  }
  sha256_init(p);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x20(%rdi), %r15
movl %r15d, %eax
andl $0x3f, %eax
movb $-0x80, %cl
movl %eax, %ebp
movb %cl, 0x28(%rbx,%rax)
incl %ebp
cmpl $0x38, %ebp
je 0x4500
andl $0x3f, %ebp
jne 0x44fa
movq %rbx, %rdi
callq 0x4569
movl %ebp, %eax
xorl %ecx, %ecx
jmp 0x44e2
shlq $0x3, %r15
pushq $0x60
popq %rax
cmpq $0x68, %rax
je 0x4520
movq %r15, %rcx
shrq $0x38, %rcx
movb %cl, (%rbx,%rax)
shlq $0x8, %r15
incq %rax
jmp 0x4507
movq %rbx, %rdi
callq 0x4569
xorl %eax, %eax
cmpq $0x8, %rax
je 0x4557
movb 0x3(%rbx,%rax,4), %cl
movb %cl, (%r14,%rax,4)
movb 0x2(%rbx,%rax,4), %cl
movb %cl, 0x1(%r14,%rax,4)
movb 0x1(%rbx,%rax,4), %cl
movb %cl, 0x2(%r14,%rax,4)
movb (%rbx,%rax,4), %cl
movb %cl, 0x3(%r14,%rax,4)
incq %rax
jmp 0x452a
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4418
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/core/remote_terminal.c
// Function: timeval_substract
int _timeval_substract (struct timeval * a,
                           struct timeval * b,
                           struct timeval * result)
{
    /* Perform the carry for the later subtraction by updating
     * y. */
    if (a->tv_usec < b->tv_usec) {
        int nsec = (b->tv_usec - a->tv_usec) / 1000000 + 1;
        b->tv_usec -= 1000000 * nsec;
        b->tv_sec += nsec;
    }

    if (a->tv_usec - b->tv_usec > 1000000) {
        int nsec = (a->tv_usec - b->tv_usec) / 1000000;
        b->tv_usec += 1000000 * nsec;
        b->tv_sec -= nsec;
    }

    /* get the result */
    result->tv_sec = a->tv_sec - b->tv_sec;
    result->tv_usec = a->tv_usec - b->tv_usec;

       /* return 1 if result is negative. */
       return a->tv_sec < b->tv_sec;
}

// Assembly:
movq %rdx, %rcx
movq 0x8(%rdi), %rax
movq (%rsi), %r8
movq 0x8(%rsi), %r9
movq %r9, %rdx
subq %rax, %rdx
jle 0x541a
movl $0xf4240, %r10d         # imm = 0xF4240
movq %rdx, %rax
cqto
idivq %r10
incl %eax
imull $0xf4240, %eax, %edx    # imm = 0xF4240
movslq %edx, %rdx
subq %rdx, %r9
movq %r9, 0x8(%rsi)
cltq
addq %rax, %r8
movq %r8, (%rsi)
movq 0x8(%rdi), %rax
subq %r9, %rax
cmpq $0xf4241, %rax          # imm = 0xF4241
jl 0x5458
movl $0xf4240, %r10d         # imm = 0xF4240
xorl %edx, %edx
divq %r10
movabsq $0xf424000000000, %rdx  # imm = 0xF424000000000
imulq %rax, %rdx
sarq $0x20, %rdx
addq %r9, %rdx
movq %rdx, 0x8(%rsi)
cltq
subq %rax, %r8
movq %r8, (%rsi)
movq 0x8(%rdi), %rax
subq %rdx, %rax
movq (%rdi), %rdx
subq %r8, %rdx
movq %rdx, (%rcx)
movq %rax, 0x8(%rcx)
movq (%rdi), %rcx
xorl %eax, %eax
cmpq (%rsi), %rcx
setl %al
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/core/remote_terminal.c
// Function: send_error_resp
static void _send_error_resp(int code, char *msg, char *msg_id, char *session_id, char *send_buf)
{
    char *tmp_buf = NULL;
    char *buf_hdr = NULL;

    tmp_buf  = sda_gen_payload_msg(code, NULL, msg);
    buf_hdr = sda_gen_msg_header(MSG_RESP_OK , strlen(tmp_buf), msg_id, session_id);
    
    memset(send_buf, 0, DEFAULT_MSG_BUFFER_LEN);
    snprintf(send_buf, DEFAULT_MSG_BUFFER_LEN, "%s%s", buf_hdr, tmp_buf); 
    rd_net_write(&g_network, NULL, send_buf, strlen(send_buf), 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %rdx
xorl %esi, %esi
callq 0x6b8c
movq %rax, %r14
movq %rax, %rdi
callq 0x2270
xorl %edi, %edi
movl %eax, %esi
movq %r12, %rdx
movq %r15, %rcx
callq 0x6ae4
movq %rax, %r15
movl $0x2000, %edx           # imm = 0x2000
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2090
leaq 0x216f(%rip), %rdx      # 0x890e
movl $0x2000, %esi           # imm = 0x2000
movq %rbx, %rdi
movq %r15, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x20b0
movq %rbx, %rdi
callq 0x2270
leaq 0x5b95(%rip), %rdi      # 0xc358
xorl %esi, %esi
movq %rbx, %rdx
movl %eax, %ecx
xorl %r8d, %r8d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2756
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/core/remote_terminal.c
// Function: del_socketfd_by_id
static inline void _del_socketfd_by_id(int fd, int *localfd_array, int len)
{
    int i = 0;
    
    for(i = 0; i < len; i++){
        if (fd == localfd_array[i]) {
            localfd_array[i] = -1;
        }
    }
}

// Assembly:
xorl %eax, %eax
cmpq $0x20, %rax
je 0x67f3
cmpl %edi, (%rsi,%rax,4)
jne 0x67ee
orl $-0x1, (%rsi,%rax,4)
incq %rax
jmp 0x67df
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/core/remote_terminal.c
// Function: sig_int_handler
static void _sig_int_handler(int sig)
{
    if (SIGINT == sig) {
        if(g_is_running == 0){
            log_info("force exit !\r\n");
            exit(0); 
        }
        g_is_running = 0; 
        log_info( "Caught signal: %s, exiting..., %d\r\n", strsignal(sig), sig);
    }
}

// Assembly:
pushq %rax
cmpl $0x2, %edi
jne 0x6ab9
cmpb $0x1, 0x591c(%rip)      # 0xc398
je 0x6abb
movb $0x1, 0x5913(%rip)      # 0xc398
pushq $0x2
popq %rdi
callq 0x2130
movl $0x2, (%rsp)
leaq 0x1bbe(%rip), %rsi      # 0x8659
leaq 0x1b64(%rip), %rdx      # 0x8606
leaq 0x222c(%rip), %r8       # 0x8cd5
pushq $0x1
popq %rdi
pushq $0x21
popq %rcx
movq %rax, %r9
xorl %eax, %eax
callq 0x403f
popq %rax
retq
leaq 0x1b97(%rip), %rsi      # 0x8659
leaq 0x1b3d(%rip), %rdx      # 0x8606
leaq 0x21f6(%rip), %r8       # 0x8cc6
pushq $0x1
popq %rdi
pushq $0x1d
popq %rcx
xorl %eax, %eax
callq 0x403f
xorl %edi, %edi
callq 0x2100
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/core/net_protocol.c
// Function: sda_gen_msg_header
char *sda_gen_msg_header(int msg_type, int payload_len, char *msg_id, char *token)
{
    static char msg[DEFAULT_MSG_HDR_LEN] = {0};

    memset(msg, 0, sizeof(msg));
    snprintf(msg, sizeof(msg) - 1, MSG_HEAD_FMT,
                    msg_type, payload_len, msg_id == NULL ? rand_string_static() : msg_id,
                    time(NULL), token == NULL ? "" : token);

    log_debug("send msg : %s\n", msg);
    return msg;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %r14
movl %esi, %ebx
movl %edi, %ebp
leaq 0x58b4(%rip), %rdi      # 0xc3b0
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x2090
testq %r14, %r14
jne 0x6b17
xorl %eax, %eax
callq 0x39ff
movq %rax, %r14
xorl %edi, %edi
callq 0x25c0
movq %rax, %r10
testq %r15, %r15
leaq 0x190a(%rip), %r11      # 0x8435
cmovneq %r15, %r11
leaq 0x587a(%rip), %r15      # 0xc3b0
leaq 0x2227(%rip), %rdx      # 0x8d64
movl $0x3ff, %esi            # imm = 0x3FF
movq %r15, %rdi
movl %ebp, %ecx
movl %ebx, %r8d
movq %r14, %r9
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x20b0
popq %rcx
popq %rdx
leaq 0x14a3(%rip), %rsi      # 0x8004
leaq 0x224f(%rip), %rdx      # 0x8db7
leaq 0x2260(%rip), %r8       # 0x8dcf
pushq $0x11
popq %rcx
xorl %edi, %edi
movq %r15, %r9
xorl %eax, %eax
callq 0x403f
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/core/net_protocol.c
// Function: sda_gen_handshake_msg
char *sda_gen_handshake_msg(char *pk, char *dn, char *ds)
{
    static char msg[DEFAULT_MSG_HDR_LEN] = {0};
    char ipaddr[256] = {0};

    //FIXME
    //get_dev_ip(ipaddr, sizeof(ipaddr));

    memset(msg,0,sizeof(msg));
    snprintf(msg, sizeof(msg), MSG_HDSK_FMT, 
                    g_uuid, pk, dn, "v2.0", 
                    ipaddr, "", "", calc_sign(g_uuid, dn, pk, ds));

    return msg; 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %r15
leaq 0x30(%rsp), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x2090
leaq 0x5f8c(%rip), %rdi      # 0xcbb0
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x2090
leaq 0x6379(%rip), %rbp      # 0xcfb0
movl $0x400, %edx            # imm = 0x400
movq %rbp, %rdi
xorl %esi, %esi
callq 0x2090
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rbx
movaps %xmm0, (%rbx)
movaps %xmm0, 0x10(%rbx)
leaq 0x6754(%rip), %r12      # 0xd3b0
movl $0x400, %edx            # imm = 0x400
movq %r12, %rdi
xorl %esi, %esi
callq 0x2090
xorl %edi, %edi
callq 0x25c0
movq %rax, %r10
subq $0x8, %rsp
leaq 0x2240(%rip), %rdx      # 0x8ec0
leaq 0x222d(%rip), %rcx      # 0x8eb4
movl $0x400, %esi            # imm = 0x400
movq %rbp, %rdi
movq %r14, 0x10(%rsp)
movq %r14, %r8
movq %r15, 0x8(%rsp)
movq %r15, %r9
xorl %eax, %eax
pushq %r10
callq 0x20b0
popq %rcx
popq %rdx
leaq 0x1353(%rip), %rsi      # 0x8004
leaq 0x20ff(%rip), %rdx      # 0x8db7
leaq 0x2230(%rip), %r8       # 0x8eef
pushq $0x2c
popq %rcx
xorl %edi, %edi
movq %rbp, %r9
xorl %eax, %eax
callq 0x403f
movq %rbp, %rdi
callq 0x2270
movq %rax, %r14
movq %r13, %rdi
callq 0x2270
leaq 0x1(%rax), %r8
movq %rbx, %rdi
movq %rbp, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x4240
leaq 0x2207(%rip), %rbx      # 0x8f04
xorl %r14d, %r14d
cmpq $0x20, %r14
je 0x6d27
movq %r12, %rdi
callq 0x2270
leaq (%rax,%r12), %rdi
movzbl 0x10(%rsp,%r14), %edx
movq %rbx, %rsi
xorl %eax, %eax
callq 0x22d0
incq %r14
jmp 0x6d00
subq $0x8, %rsp
leaq 0x1703(%rip), %r10      # 0x8435
leaq 0x2176(%rip), %r11      # 0x8eaf
leaq 0x5e70(%rip), %rbx      # 0xcbb0
leaq 0x20bb(%rip), %rdx      # 0x8e02
leaq 0x2166(%rip), %rcx      # 0x8eb4
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
movq 0x8(%rsp), %r8
movq 0x10(%rsp), %r9
xorl %eax, %eax
pushq %r12
pushq %r10
pushq %r10
leaq 0x50(%rsp), %r10
pushq %r10
pushq %r11
callq 0x20b0
addq $0x30, %rsp
movq %rbx, %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/core/config_manager.c
// Function: deinit_cfg
void deinit_cfg()
{
	if(g_cfg == NULL)
		return;

	free(g_cfg->cloud_ip);
	free(g_cfg->cloud_port);
	free(g_cfg->cert_path);
	if(g_cfg->pk)
		free(g_cfg->pk);
	if(g_cfg->dn)
		free(g_cfg->dn);
	if(g_cfg->ds)
		free(g_cfg->ds);

    free(g_cfg);
    g_cfg = NULL;
	log_info("deinit cfg ok.");
}

// Assembly:
pushq %rbx
movq 0x607d(%rip), %rbx      # 0xd7b0
testq %rbx, %rbx
je 0x77a2
movq (%rbx), %rdi
callq 0x2250
movq 0x8(%rbx), %rdi
callq 0x2250
movq 0x10(%rbx), %rdi
callq 0x2250
movq 0x18(%rbx), %rdi
callq 0x2250
movq 0x20(%rbx), %rdi
callq 0x2250
movq 0x28(%rbx), %rdi
callq 0x2250
movq %rbx, %rdi
callq 0x2250
andq $0x0, 0x6033(%rip)      # 0xd7b0
leaq 0xed5(%rip), %rsi       # 0x8659
leaq 0x1784(%rip), %rdx      # 0x8f0f
leaq 0x188c(%rip), %r8       # 0x901e
pushq $0x1
popq %rdi
movl $0xdd, %ecx
xorl %eax, %eax
popq %rbx
jmp 0x403f
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/core/session_mgr.c
// Function: init_session_system
int init_session_system()
{
    if(g_ht != NULL)
        return 0;

    g_ht = ht_init(DEFAULT_SESSION_COUNT * 3);
    if(g_ht == NULL){
        log_error("failed to init session system: %s", strerror(errno)); 
        return -1;
    }
    g_session_count = 0;
    return 0;
}

// Assembly:
pushq %rbx
xorl %ebx, %ebx
cmpq $0x0, 0x6009(%rip)      # 0xd7b8
jne 0x7802
pushq $0x60
popq %rdi
callq 0x3a1c
movq %rax, 0x5ff8(%rip)      # 0xd7b8
testq %rax, %rax
je 0x77ce
andl $0x0, 0x5ff4(%rip)      # 0xd7c0
jmp 0x7802
callq 0x2400
movl (%rax), %edi
callq 0x2330
leaq 0xe1f(%rip), %rsi       # 0x8600
leaq 0x19d5(%rip), %rdx      # 0x91bd
leaq 0x19e5(%rip), %r8       # 0x91d4
pushq $0x3
popq %rdi
pushq $0x1b
popq %rcx
movq %rax, %r9
xorl %eax, %eax
callq 0x403f
pushq $-0x1
popq %rbx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/core/session_mgr.c
// Function: deinit_session_system
void deinit_session_system()
{
    if(g_ht == NULL)
        return;
    ht_destroy(g_ht);
    g_session_count = 0;
    g_ht = NULL;
}

// Assembly:
movq 0x5fab(%rip), %rdi      # 0xd7b8
testq %rdi, %rdi
je 0x782b
pushq %rax
callq 0x3fcf
andl $0x0, 0x5fa1(%rip)      # 0xd7c0
andq $0x0, 0x5f91(%rip)      # 0xd7b8
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/core/session_mgr.c
// Function: is_session_avalibe
int is_session_avalibe()
{
    if(g_session_count >=  DEFAULT_SESSION_COUNT){
        //clear timeout session 
        return clear_timeout_session();
    }    

    return 1;
}

// Assembly:
cmpl $0x20, 0x5f8d(%rip)     # 0xd7c0
jl 0x7890
pushq %rbx
subq $0x10, %rsp
andl $0x0, 0xc(%rsp)
movq 0x5f72(%rip), %rdi      # 0xd7b8
testq %rdi, %rdi
jne 0x7874
leaq 0xdae(%rip), %rsi       # 0x8600
leaq 0x1964(%rip), %rdx      # 0x91bd
leaq 0x19a7(%rip), %r8       # 0x9207
pushq $0x3
popq %rdi
pushq $0x3e
popq %rcx
xorl %eax, %eax
callq 0x403f
movq 0x5f44(%rip), %rdi      # 0xd7b8
leaq 0x423(%rip), %rsi       # 0x7c9e
leaq 0xc(%rsp), %rbx
movq %rbx, %rdx
callq 0x3edb
movl (%rbx), %eax
addq $0x10, %rsp
popq %rbx
retq
pushq $0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/core/session_mgr.c
// Function: get_timestamp_by_session_id
int _get_timestamp_by_session_id(char *session_id)
{
    SESSION_ITEM  *item = NULL; 
    
    if(g_ht == NULL || session_id == NULL){
        log_error("session system is not ready, please retry ");
        return -1;
    }

    item = ht_find(g_ht, session_id, DEFAULT_SESSION_LEN, NULL, NULL);
    if(item == NULL){
        log_error("could not find socketfd for session: %s ", session_id);
        return -1;
    }
    
    return item->last_modify_time;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x5d9b(%rip), %rdi      # 0xd7b8
testq %rdi, %rdi
setne %al
testq %rbx, %rbx
setne %cl
testb %al, %cl
jne 0x7a53
leaq 0xbcc(%rip), %rsi       # 0x8600
leaq 0x1782(%rip), %rdx      # 0x91bd
leaq 0x17c5(%rip), %r8       # 0x9207
pushq $0x3
popq %rdi
movl $0x81, %ecx
xorl %eax, %eax
callq 0x403f
jmp 0x7a94
pushq $0x40
popq %rdx
movq %rbx, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3b7e
testq %rax, %rax
je 0x7a6d
movl 0x8(%rax), %eax
jmp 0x7a97
leaq 0xb8c(%rip), %rsi       # 0x8600
leaq 0x1742(%rip), %rdx      # 0x91bd
leaq 0x1854(%rip), %r8       # 0x92d6
pushq $0x3
popq %rdi
movl $0x87, %ecx
movq %rbx, %r9
xorl %eax, %eax
callq 0x403f
pushq $-0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/core/session_mgr.c
// Function: free_session
void free_session(char *session_id)
{
    if(g_ht == NULL){
        log_error("session system is not ready, please retry ");
        return ;
    }
    if(_get_timestamp_by_session_id(session_id) >= 0){
        ht_del_lockless(g_ht, session_id, DEFAULT_SESSION_LEN);
    
        --g_session_count;
        log_debug("current session count: %d\n", g_session_count);
    }
}

// Assembly:
pushq %rbx
cmpq $0x0, 0x5d16(%rip)      # 0xd7b8
je 0x7af7
movq %rdi, %rbx
callq 0x7a12
testl %eax, %eax
js 0x7b1c
movq 0x5d01(%rip), %rdi      # 0xd7b8
pushq $0x40
popq %rdx
movq %rbx, %rsi
callq 0x3dc1
movl 0x5cf7(%rip), %r9d      # 0xd7c0
decl %r9d
movl %r9d, 0x5ced(%rip)      # 0xd7c0
leaq 0x52a(%rip), %rsi       # 0x8004
leaq 0x16dc(%rip), %rdx      # 0x91bd
leaq 0x1817(%rip), %r8       # 0x92ff
xorl %edi, %edi
movl $0x98, %ecx
xorl %eax, %eax
popq %rbx
jmp 0x403f
leaq 0xb02(%rip), %rsi       # 0x8600
leaq 0x16b8(%rip), %rdx      # 0x91bd
leaq 0x16fb(%rip), %r8       # 0x9207
pushq $0x3
popq %rdi
movl $0x91, %ecx
xorl %eax, %eax
popq %rbx
jmp 0x403f
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/core/session_mgr.c
// Function: get_session_id_by_socketfd
char *get_session_id_by_socketfd(int *socketfd)
{
    char *ret = NULL;

    if(g_ht == NULL){
        log_error("session system is not ready, please retry ");
        return 0;
    }

    ret = ht_iterator_lockless(g_ht, _get_socketfd, socketfd);

    log_debug("get session id: %s by socketfd: %d\n", ret, *socketfd);
    return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x5c8c(%rip), %rdi      # 0xd7b8
testq %rdi, %rdi
je 0x7b71
leaq 0x6a(%rip), %rsi        # 0x7ba2
movq %r14, %rdx
callq 0x3edb
movq %rax, %rbx
movl (%r14), %eax
movl %eax, (%rsp)
leaq 0x4b4(%rip), %rsi       # 0x8004
leaq 0x1666(%rip), %rdx      # 0x91bd
leaq 0x17bc(%rip), %r8       # 0x931a
xorl %edi, %edi
movl $0xb6, %ecx
movq %rbx, %r9
xorl %eax, %eax
callq 0x403f
jmp 0x7b97
leaq 0xa88(%rip), %rsi       # 0x8600
leaq 0x163e(%rip), %rdx      # 0x91bd
leaq 0x1681(%rip), %r8       # 0x9207
xorl %ebx, %ebx
pushq $0x3
popq %rdi
movl $0xb0, %ecx
xorl %eax, %eax
callq 0x403f
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/core/session_mgr.c
// Function: get_socketfd_by_session_id
int get_socketfd_by_session_id(char *session_id)
{
    SESSION_ITEM  *item = NULL; 
    
    if(g_ht == NULL || session_id == NULL){
        log_error("session system is not ready, please retry ");
        return -1;
    }

    item = ht_find(g_ht, session_id, DEFAULT_SESSION_LEN, NULL, NULL);
    if(item == NULL){
        log_error("could not find socketfd for session: %s ", session_id);
        return -1;
    }
    
    log_debug("get socketfd: %d by session id: %s \n", *item->sockfd, session_id);
    item->last_modify_time = time(NULL);
    return *item->sockfd;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x5bd9(%rip), %rdi      # 0xd7b8
testq %rdi, %rdi
setne %al
testq %rbx, %rbx
setne %cl
testb %al, %cl
jne 0x7c15
leaq 0xa0a(%rip), %rsi       # 0x8600
leaq 0x15c0(%rip), %rdx      # 0x91bd
leaq 0x1603(%rip), %r8       # 0x9207
pushq $0x3
popq %rdi
movl $0xbf, %ecx
xorl %eax, %eax
callq 0x403f
jmp 0x7c93
pushq $0x40
popq %rdx
movq %rbx, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3b7e
testq %rax, %rax
je 0x7c6c
movq %rax, %r14
movq (%rax), %rax
movl (%rax), %r9d
movq %rbx, (%rsp)
leaq 0x3c6(%rip), %rsi       # 0x8004
leaq 0x1578(%rip), %rdx      # 0x91bd
leaq 0x16f2(%rip), %r8       # 0x933e
xorl %edi, %edi
movl $0xc9, %ecx
xorl %eax, %eax
callq 0x403f
xorl %edi, %edi
callq 0x25c0
movq %rax, 0x8(%r14)
movq (%r14), %rax
movl (%rax), %eax
jmp 0x7c96
leaq 0x98d(%rip), %rsi       # 0x8600
leaq 0x1543(%rip), %rdx      # 0x91bd
leaq 0x1655(%rip), %r8       # 0x92d6
pushq $0x3
popq %rdi
movl $0xc5, %ecx
movq %rbx, %r9
xorl %eax, %eax
callq 0x403f
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/xiaowenhuyuehu[P]remote_access/src/core/session_mgr.c
// Function: delete_item
static int _delete_item(void *key, void *val, void *usr)
{
    SESSION_ITEM  *item = val; 

    if(item->last_modify_time + DEFAULT_SESSION_TIMEOUT < time(NULL)){
        log_info("delete timeout session:  %s ", (char *)key);
        *(int *)usr += 1; 
        *item->sockfd = -1;
        free_session(key);
    }

    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movl $0x708, %r12d           # imm = 0x708
addq 0x8(%rsi), %r12
xorl %edi, %edi
callq 0x25c0
cmpq %rax, %r12
jge 0x7cfb
leaq 0x98d(%rip), %rsi       # 0x8659
leaq 0x14ea(%rip), %rdx      # 0x91bd
leaq 0x1689(%rip), %r8       # 0x9363
pushq $0x1
popq %rdi
pushq $0x30
popq %rcx
movq %rbx, %r9
xorl %eax, %eax
callq 0x403f
incl (%r15)
movq (%r14), %rax
orl $-0x1, (%rax)
movq %rbx, %rdi
callq 0x7a99
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/983[P]bigint/c_examples.c
// Function: main
int main(){
    char buf[65536];

    /* neat trick to avoid having to write &a, &b, &c everywhere */
    bigint a[1], b[1], c[1];

    /* bigints have to be initialized (same as memset'ed to zero) */
    bigint_init(a);
    bigint_init(b);
    bigint_init(c);

    /* create bigint from string */
    bigint_from_str(a, "123456789");
    bigint_from_str(b, "987654321");

    /* c = a * b */
    /* first parameter is destination parameter */
    bigint_mul(c, a, b);

    /* write and print */
    puts(bigint_write(buf, sizeof(buf), c));

    /* bigints have to be free'd */
    bigint_free(a);
    bigint_free(b);
    bigint_free(c);

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10060, %rsp          # imm = 0x10060
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0x134c
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x134c
movq %rsp, %r15
movq %r15, %rdi
callq 0x134c
leaq 0x2e10(%rip), %rsi      # 0x4004
movq %rbx, %rdi
callq 0x1f5a
leaq 0x2e0b(%rip), %rsi      # 0x400e
movq %r14, %rdi
callq 0x1f5a
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1d75
leaq 0x60(%rsp), %rdi
movl $0x10000, %esi          # imm = 0x10000
movq %r15, %rdx
callq 0x2bdd
movq %rax, %rdi
callq 0x1040
movq %rbx, %rdi
callq 0x13ce
movq %r14, %rdi
callq 0x13ce
movq %r15, %rdi
callq 0x13ce
xorl %eax, %eax
addq $0x10060, %rsp          # imm = 0x10060
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_depack.c
// Function: put_buffer
ULONG put_buffer(ULONG pos,ULONG size)
{ // writes specified part of buffer to the output file (with wrapping!)
	ULONG size1,size2,success;

	if( (pos+size)<=DBSIZE )
	{ // no wrapping needed
		return (size==fwrite(&dbuf[pos],1,size,file_out))?1:0;
	}
	else
	{ // wrapping
		size1=(DBSIZE-pos);
		size2=size-size1;

		success=  (size1==fwrite(&dbuf[pos],1,size1,file_out))?1:0;
		success&= (size2==fwrite(&dbuf[0],  1,size2,file_out))?1:0;
		return success;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
leal (%rbx,%rdi), %eax
cmpl $0x2000, %eax           # imm = 0x2000
ja 0x17a6
movl %ebx, %ebx
movl %edi, %edi
addq 0x3854(%rip), %rdi      # 0x4fe0
leaq 0x393d(%rip), %rax      # 0x50d0
movq (%rax), %rcx
pushq $0x1
popq %rsi
movq %rbx, %rdx
callq 0x1120
cmpq %rbx, %rax
jmp 0x17f6
movl $0x2000, %r14d          # imm = 0x2000
subl %edi, %r14d
subl %r14d, %ebx
movl %edi, %edi
leaq 0x3935(%rip), %r15      # 0x50f0
addq %r15, %rdi
leaq 0x390b(%rip), %rbp      # 0x50d0
movq (%rbp), %rcx
pushq $0x1
popq %r12
movq %r12, %rsi
movq %r14, %rdx
callq 0x1120
movq %rax, %r13
xorq %r14, %r13
movq (%rbp), %rcx
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x1120
xorq %rbx, %rax
orq %r13, %rax
sete %al
movzbl %al, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_depacker.c
// Function: repeat
void repeat(LONG disp,ULONG len)
{ // repeat len bytes with disp displacement (negative)
  // uses dbpos & dbuf

	ULONG i;

	for(i=0;i<len;i++)
	{
		dbuf[DBMASK&dbpos]=dbuf[DBMASK&(dbpos+disp)];
		dbpos++;
	}
}

// Assembly:
movl 0x5694(%rip), %eax      # 0x70f0
movl $0x1fff, %ecx           # imm = 0x1FFF
leaq 0x3688(%rip), %rdx      # 0x50f0
subl $0x1, %esi
jb 0x1a8c
leal (%rdi,%rax), %r8d
andl %ecx, %r8d
movb (%r8,%rdx), %r8b
movl %eax, %r9d
andl %ecx, %r9d
movb %r8b, (%r9,%rdx)
incl %eax
movl %eax, 0x5666(%rip)      # 0x70f0
jmp 0x1a68
retq
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_depacker.c
// Function: get_bigdisp
LONG get_bigdisp(void)
{ // fetches 'big' displacement (-1..-4352)
  // returns negative displacement or ZERO if failed either get_bits() or get_byte()

	ULONG bits,byte;

	bits=get_bits(1);
#ifdef ERRORS
	if( bits==0xFFFFFFFF ) return 0;
#endif

	if( bits )
	{ // longer displacement
		bits=get_bits(4);
#ifdef ERRORS
		if( bits==0xFFFFFFFF ) return 0;
#endif
		byte=get_byte();
#ifdef ERRORS
		if( byte==0xFFFFFFFF ) return 0;
#endif
		return (LONG)( ((0xFFFFF000|(bits<<8))-0x0100)|byte );
	}
	else
	{ // shorter displacement
		byte=get_byte();
#ifdef ERRORS
		if( byte==0xFFFFFFFF ) return 0;
#endif
		return (LONG)( 0xFFFFFF00|byte );
	}
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
pushq $0x1
popq %rdi
callq 0x19ff
xorl %ebx, %ebx
cmpl $-0x1, %eax
je 0x1ae3
testl %eax, %eax
jne 0x1aba
callq 0x173d
movl %eax, %ecx
orl $0xffffff00, %ecx       # imm = 0xFFFFFF00
xorl %ebx, %ebx
cmpl $-0x1, %eax
cmovnel %ecx, %ebx
jmp 0x1ae3
pushq $0x4
popq %rdi
callq 0x19ff
cmpl $-0x1, %eax
je 0x1ae3
movl %eax, %ebp
callq 0x173d
cmpl $-0x1, %eax
je 0x1ae3
orl $-0x10, %ebp
shll $0x8, %ebp
addl $0xffffff00, %ebp       # imm = 0xFFFFFF00
orl %ebp, %eax
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_emit.c
// Function: emit_code
ULONG emit_code(struct lzinfo * lz)
{ // emits given lz code to the output stream

	// write bits

	emit_bits(lz->bits,lz->bitsnum);


	// write byte, if any

	if( lz->byte!=0xFFFFFFFF )
	{
		oubuf[ob_freepos++]=(UBYTE)(lz->byte&0x000000FF);
	}


	// flush to disk if needed

	if( ob_freepos>(OUBUFSIZE-8) )
	{
		// write up to current bit position
		if( ob_bitpos!=fwrite( oubuf, 1, ob_bitpos, file_out ) )  return 0;

		// move remaining part of buffer to the beginning
		memcpy( oubuf, &oubuf[ob_bitpos], OUBUFSIZE-ob_bitpos);

		// update pointers
		ob_freepos-=ob_bitpos;
		ob_bitpos=0;
	}

	return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x10(%rdi), %edi
movl 0x14(%rbx), %esi
callq 0x1bc5
movl 0xc(%rbx), %eax
cmpl $-0x1, %eax
je 0x1b52
movl 0x56c7(%rip), %edx      # 0x7204
leal 0x1(%rdx), %ecx
movl %ecx, 0x56be(%rip)      # 0x7204
leaq 0x55b3(%rip), %rsi      # 0x7100
movb %al, (%rdx,%rsi)
jmp 0x1b58
movl 0x56ac(%rip), %ecx      # 0x7204
pushq $0x1
popq %rbp
cmpl $0xf9, %ecx
jb 0x1bbe
movl 0x5696(%rip), %r14d     # 0x7200
leaq 0x355f(%rip), %rax      # 0x50d0
movq (%rax), %rcx
leaq 0x5585(%rip), %rbx      # 0x7100
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x1120
movq %rax, %rcx
xorl %eax, %eax
cmpq %r14, %rcx
jne 0x1bc0
movl 0x5666(%rip), %r14d     # 0x7200
movq %r14, %rsi
addq %rbx, %rsi
movl $0x100, %edx            # imm = 0x100
subl %r14d, %edx
movq %rbx, %rdi
callq 0x1060
subl %r14d, 0x564d(%rip)     # 0x7204
andl $0x0, 0x5642(%rip)      # 0x7200
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_emit.c
// Function: emit_bits
void emit_bits(ULONG bits,ULONG bitsnum)
{
	ULONG i,shifter;

	shifter=bits;

	for(i=0;i<bitsnum;i++)
	{
		if( ob_bits==8 )
		{
			ob_bitpos=ob_freepos;
			ob_freepos++;
			ob_bits=0;
		}

		oubuf[ob_bitpos]=(UBYTE)( (oubuf[ob_bitpos]<<1) | (UBYTE)( shifter>>31 ));

		ob_bits++;

		shifter<<=1;
	}
}

// Assembly:
movl 0x563c(%rip), %r8d      # 0x7208
movl 0x5632(%rip), %ecx      # 0x7204
movl 0x5628(%rip), %edx      # 0x7200
leaq 0x5521(%rip), %rax      # 0x7100
subl $0x1, %esi
jb 0x1c1c
cmpl $0x8, %r8d
jne 0x1bfd
movl %ecx, 0x5610(%rip)      # 0x7200
movl %ecx, %edx
incl %ecx
movl %ecx, 0x560a(%rip)      # 0x7204
xorl %r8d, %r8d
movl %edx, %r9d
movzbl (%r9,%rax), %r10d
shldl $0x1, %edi, %r10d
movb %r10b, (%r9,%rax)
incl %r8d
movl %r8d, 0x55f0(%rip)      # 0x7208
addl %edi, %edi
jmp 0x1bdf
retq
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_emit.c
// Function: emit_finish
ULONG emit_finish(void)
{ // finishes output stream outting (flushes everyth, writes stopping bitcode)

	// write stopping bitcode
	emit_bits(0x60100000,12);

	// fill up last unfinished 'bit'-byte
	while( ob_bits<8 )
	{
		oubuf[ob_bitpos]<<=1;
		ob_bits++;
	}

	// write remaining part of buffer
	if( ob_freepos!=fwrite( oubuf, 1, ob_freepos, file_out ) )  return 0;

	return 1;
}

// Assembly:
pushq %rbx
pushq $0xc
popq %rsi
movl $0x60100000, %edi       # imm = 0x60100000
callq 0x1bc5
movl 0x55d7(%rip), %eax      # 0x7208
movl 0x55c9(%rip), %ecx      # 0x7200
leaq 0x54c2(%rip), %rdx      # 0x7100
cmpl $0x7, %eax
ja 0x1c50
shlb (%rcx,%rdx)
incl %eax
movl %eax, 0x55ba(%rip)      # 0x7208
jmp 0x1c3e
movl 0x55ae(%rip), %ebx      # 0x7204
leaq 0x3473(%rip), %rax      # 0x50d0
movq (%rax), %rcx
leaq 0x5499(%rip), %rdi      # 0x7100
pushq $0x1
popq %rsi
movq %rbx, %rdx
callq 0x1120
xorl %ecx, %ecx
cmpq %rbx, %rax
sete %cl
movl %ecx, %eax
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_hash.c
// Function: make_hash
void make_hash(void)
{ // makes hash for every byte of input file
  // for position i, hash is from bytes at [i-2],[i-1],[i]
  // first and second bytes does not have valid hash values

	UBYTE curr,prev,prev2;
	ULONG i;

	prev=curr=0;

	for(i=0;i<inlen;i++)
	{
		prev2=(UBYTE)((prev>>1)|(prev<<7));
		prev=(UBYTE)((curr>>1)|(curr<<7));
		curr=indata[i];

		hash[i]=(UBYTE)(prev2^prev^curr);
	}
}

// Assembly:
xorl %eax, %eax
leaq 0x3421(%rip), %rcx      # 0x50d8
leaq 0x3422(%rip), %rdx      # 0x50e0
xorl %edi, %edi
xorl %esi, %esi
movl (%rcx), %r8d
cmpq %r8, %rax
jae 0x1cf2
rorb %sil
movq (%rdx), %r8
rorb %dil
movb (%r8,%rax), %r8b
xorb %sil, %dil
xorb %r8b, %dil
movq 0x552c(%rip), %r9       # 0x7210
movb %dil, (%r9,%rax)
incq %rax
movl %esi, %edi
movl %r8d, %esi
jmp 0x1cc2
retq
nop
// File: /workspace/github_c_makefile_star2_O2/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_lz.c
// Function: end_lz
void end_lz(void)
{ // ends codes[] array filling by setting stopflag
	codes[codepos].disp=0;
	codes[codepos].length=1;

 if(codepos>=256) printf("end_lz(): overflow!\n");
}

// Assembly:
movl 0x551e(%rip), %eax      # 0x7220
leaq 0x5527(%rip), %rcx      # 0x7230
movl $0x1, (%rcx,%rax,4)
cmpq $0x100, %rax            # imm = 0x100
jb 0x1d24
leaq 0x16f9(%rip), %rdi      # 0x3418
jmp 0x1110
retq