LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/dict.c
// Function: dict_find
dict_entry *dict_find(dict *d, const void *key, int keylen)
{
    dict_entry *he;
    unsigned int h, idx, table;

    if (d->ht[0].size == 0)
        return NULL;            /* We don't have a table at all */
    if (dict_is_rehashing(d))
        _dict_rehash_step(d);
    h = dict_gen_hash_function((const unsigned char*)key, keylen);

    unsigned int keylen_ = keylen;

    for (table = 0; table <= 1; table++)
    {
        idx = h & d->ht[table].sizemask;
        he = d->ht[table].table[idx];
        while (he)
        {
            if ((keylen_ == he->keylen) && (memcmp(key, he->key, keylen_) == 0))
            {
                return he;
            }
            he = he->next;
        }
        if (!dict_is_rehashing(d))
            return NULL;
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpq $0x0, 0x10(%rdi)
je 0x2a78
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r12
cmpl $-0x1, 0x48(%rdi)
je 0x29fe
movq %r12, %rdi
callq 0x295b
leaq 0x8(%r12), %rax
movq %rax, -0x40(%rbp)
movq %r14, %rdi
movl %ebx, %esi
callq 0x2504
movl %eax, -0x2c(%rbp)
movl %ebx, %r13d
xorl %r15d, %r15d
movq %r12, -0x38(%rbp)
cmpq $0x2, %r15
je 0x2a78
movq %r15, %rax
shlq $0x5, %rax
movq -0x40(%rbp), %rcx
movl 0x10(%rcx,%rax), %r12d
andl -0x2c(%rbp), %r12d
shlq $0x3, %r12
addq (%rcx,%rax), %r12
movq (%r12), %r12
testq %r12, %r12
je 0x2a69
cmpl %ebx, (%r12)
jne 0x2a63
movq 0x8(%r12), %rsi
movq %r14, %rdi
movq %r13, %rdx
callq 0x22c0
testl %eax, %eax
je 0x2a7b
addq $0x18, %r12
jmp 0x2a40
incq %r15
movq -0x38(%rbp), %r12
cmpl $-0x1, 0x48(%r12)
jne 0x2a1e
xorl %r12d, %r12d
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/dict.c
// Function: dict_generic_delete
static int dict_generic_delete(dict *d, const void *key, int keylen, int nofree)
{
    unsigned int h, idx;
    dict_entry *he, *prev_he;
    int table;

    if (d->ht[0].size == 0)
        return DICT_ERR;        /* d->ht[0].table is NULL */
    if (dict_is_rehashing(d))
        _dict_rehash_step(d);
    h = dict_gen_hash_function((const unsigned char*)key, keylen);

    unsigned int keylen_ = keylen;

    for (table = 0; table <= 1; table++)
    {
        idx = h & d->ht[table].sizemask;
        he = d->ht[table].table[idx];
        prev_he = NULL;
        while (he)
        {
            //if (memcmp(key, he->key, keylen) == 0)
            if ((keylen_ == he->keylen) && (memcmp(key, he->key, keylen_) == 0))
            {
                /* Unlink the element from the list */
                if (prev_he)
                    prev_he->next = he->next;
                else
                    d->ht[table].table[idx] = he->next;
                if (!nofree)
                {
                    free(he->key);
                    free(he->val);
                }
                free(he);
                d->ht[table].used--;
                return DICT_OK;
            }
            prev_he = he;
            he = he->next;
        }
        if (!dict_is_rehashing(d))
            break;
    }
    return DICT_ERR;            /* not found */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, -0x38(%rbp)
pushq $0x1
popq %rax
cmpq $0x0, 0x10(%rdi)
je 0x2b9f
movl %edx, %r15d
movq %rdi, %r14
movl %ecx, -0x2c(%rbp)
cmpl $-0x1, 0x48(%rdi)
je 0x2ad0
movq %r14, %rdi
callq 0x295b
leaq 0x8(%r14), %rax
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rdi
movl %r15d, %esi
callq 0x2504
movl %eax, -0x30(%rbp)
movl %r15d, %ebx
xorl %eax, %eax
movq %r14, -0x40(%rbp)
cmpq $0x2, %rax
je 0x2b5d
movq %rax, -0x58(%rbp)
shlq $0x5, %rax
movq -0x50(%rbp), %rdx
leaq (%rdx,%rax), %rcx
movq %rcx, -0x48(%rbp)
movl 0x10(%rdx,%rax), %r13d
andl -0x30(%rbp), %r13d
shlq $0x3, %r13
addq (%rdx,%rax), %r13
movq %r13, %rax
xorl %r12d, %r12d
movq (%rax), %r14
testq %r14, %r14
je 0x2b4b
cmpl %r15d, (%r14)
jne 0x2b42
movq 0x8(%r14), %rsi
movq -0x38(%rbp), %rdi
movq %rbx, %rdx
callq 0x22c0
testl %eax, %eax
je 0x2b62
leaq 0x18(%r14), %rax
movq %r14, %r12
jmp 0x2b21
movq -0x58(%rbp), %rax
incq %rax
movq -0x40(%rbp), %r14
cmpl $-0x1, 0x48(%r14)
jne 0x2af0
pushq $0x1
popq %rax
jmp 0x2b9f
leaq 0x18(%r12), %rax
testq %r12, %r12
movq 0x18(%r14), %rcx
cmoveq %r13, %rax
movq %rcx, (%rax)
cmpl $0x0, -0x2c(%rbp)
jne 0x2b8d
movq 0x8(%r14), %rdi
callq 0x2030
movq 0x10(%r14), %rdi
callq 0x2030
movq %r14, %rdi
callq 0x2030
movq -0x48(%rbp), %rax
decq 0x18(%rax)
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/dict.c
// Function: dict_clear
int _dict_clear(dict *d, dictht *ht)
{
    unsigned long i;

    /* Free all the elements */
    for (i = 0; i < ht->size && ht->used > 0; i++)
    {
        dict_entry *he, *next_he;

        if ((he = ht->table[i]) == NULL)
            continue;
        while (he)
        {
            next_he = he->next;

            free(he->key);
            free(he->val);
            free(he);

            ht->used--;
            he = next_he;
        }
    }
    /* Free the table and the allocated cache structure */
    free(ht->table);
    /* Re-initialize the table */
    _dict_reset(ht);

    return DICT_OK;             /* never fails */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
xorl %r15d, %r15d
cmpq 0x8(%rbx), %r15
jae 0x2c18
cmpq $0x0, 0x18(%rbx)
movq (%rbx), %rdi
je 0x2c1b
movq (%rdi,%r15,8), %r14
testq %r14, %r14
jne 0x2c0e
jmp 0x2c13
movq 0x8(%r14), %rdi
movq 0x18(%r14), %r12
callq 0x2030
movq 0x10(%r14), %rdi
callq 0x2030
movq %r14, %rdi
callq 0x2030
decq 0x18(%rbx)
movq %r12, %r14
testq %r14, %r14
jne 0x2be9
incq %r15
jmp 0x2bce
movq (%rbx), %rdi
callq 0x2030
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/dict.c
// Function: dict_get_iterator
dict_iterator *dict_get_iterator(dict *d)
{
    dict_iterator *iter = (dict_iterator*)malloc(sizeof(*iter));

    iter->d = d;
    iter->table = 0;
    iter->index = -1;
    iter->safe = 0;
    iter->entry = NULL;
    iter->next_entry = NULL;
    return iter;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x28
popq %rdi
callq 0x22a0
movq %rbx, (%rax)
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
movq %rcx, 0x8(%rax)
andl $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/dict.c
// Function: dict_next
dict_entry *dict_next(dict_iterator *iter)
{
    while (1)
    {
        if (iter->entry == NULL)
        {
            dictht *ht = &iter->d->ht[iter->table];
            if (iter->safe && iter->index == -1 && iter->table == 0)
                iter->d->iterators++;
            iter->index++;
            if (iter->index >= (signed) ht->size)
            {
                if (dict_is_rehashing(iter->d) && iter->table == 0)
                {
                    iter->table++;
                    iter->index = 0;
                    ht = &iter->d->ht[1];
                }
                else
                {
                    break;
                }
            }
            iter->entry = ht->table[iter->index];
        }
        else
        {
            iter->entry = iter->next_entry;
        }
        if (iter->entry)
        {
            /* We need to save the 'next' here, the iterator user
             * may delete the entry we are returning. */
            iter->next_entry = iter->entry->next;
            return iter->entry;
        }
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x20(%rdi), %rcx
cmpq $0x0, 0x18(%rdi)
movq %rcx, %rdx
jne 0x2d30
movq (%rdi), %rdx
movslq 0x8(%rdi), %rsi
movq %rsi, %rax
shlq $0x5, %rax
addq %rdx, %rax
addq $0x8, %rax
cmpl $0x0, 0x10(%rdi)
movl 0xc(%rdi), %r8d
je 0x2cfb
movl %r8d, %r9d
notl %r9d
orl %esi, %r9d
jne 0x2cfb
incl 0x4c(%rdx)
incl %r8d
movl %r8d, 0xc(%rdi)
cmpl 0x8(%rax), %r8d
jl 0x2d26
xorl %eax, %eax
cmpl $-0x1, 0x48(%rdx)
je 0x2d43
testl %esi, %esi
jne 0x2d43
movq $0x1, 0x8(%rdi)
addq $0x28, %rdx
xorl %r8d, %r8d
movq %rdx, %rax
movslq %r8d, %rdx
shlq $0x3, %rdx
addq (%rax), %rdx
movq (%rdx), %rax
movq %rax, 0x18(%rdi)
testq %rax, %rax
je 0x2cce
movq 0x18(%rax), %rdx
movq %rdx, (%rcx)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/dict.c
// Function: dict_get_randomKey
dict_entry *dict_get_randomKey(dict *d)
{
    dict_entry *he, *orighe;
    unsigned int h;
    int listlen, listele;

    if (dict_size(d) == 0)
        return NULL;
    if (dict_is_rehashing(d))
        _dict_rehash_step(d);
    if (dict_is_rehashing(d))
    {
        do
        {
            h = random() % (d->ht[0].size + d->ht[1].size);
            he = (h >= d->ht[0].size) ? d->ht[1].table[h - d->ht[0].size] :
                d->ht[0].table[h];
        }
        while (he == NULL);
    }
    else
    {
        do
        {
            h = random() & d->ht[0].sizemask;
            he = d->ht[0].table[h];
        }
        while (he == NULL);
    }

    /* Now we found a non empty bucket, but it is a linked
     * list and we need to get a random element from the list.
     * The only sane way to do so is counting the elements and
     * select a random index. */
    listlen = 0;
    orighe = he;
    while (he)
    {
        he = he->next;
        listlen++;
    }
    listele = random() % listlen;
    he = orighe;
    while (listele-- && he)
        he = he->next;
    return he;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq 0x20(%rdi), %rax
addq 0x40(%rdi), %rax
jne 0x2d8b
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
movq %rdi, %rbx
cmpl $-0x1, 0x48(%rdi)
je 0x2de0
movq %rbx, %rdi
callq 0x295b
cmpl $-0x1, 0x48(%rbx)
je 0x2de0
callq 0x2280
movq 0x10(%rbx), %rsi
movq 0x30(%rbx), %rcx
addq %rsi, %rcx
xorl %edx, %edx
divq %rcx
movl %edx, %ecx
movq %rcx, %rax
subq %rsi, %rax
jae 0x2dce
shlq $0x3, %rcx
addq 0x8(%rbx), %rcx
movq %rcx, %rax
jmp 0x2dd6
shlq $0x3, %rax
addq 0x28(%rbx), %rax
movq (%rax), %r14
testq %r14, %r14
je 0x2da2
jmp 0x2df5
callq 0x2280
movq 0x8(%rbx), %rcx
andl 0x18(%rbx), %eax
movq (%rcx,%rax,8), %r14
testq %r14, %r14
je 0x2de0
xorl %ebx, %ebx
movq %r14, %rax
testq %rax, %rax
je 0x2e08
movq 0x18(%rax), %rax
incq %rbx
jmp 0x2dfa
callq 0x2280
cqto
idivq %rbx
addl $-0x1, %edx
jae 0x2d83
testq %r14, %r14
je 0x2d83
movq 0x18(%r14), %r14
jmp 0x2e12
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/dict.c
// Function: dict_print_stats
void dict_print_stats(dict *d)
{
    _dict_print_stats_ht(&d->ht[0]);
    if (dict_is_rehashing(d))
    {
        printf("-- Rehashing into ht[1]:\n");
        _dict_print_stats_ht(&d->ht[1]);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x8, %rdi
callq 0x2e8f
cmpl $-0x1, 0x48(%rbx)
je 0x2e88
leaq 0x4251(%rip), %rdi      # 0x70c5
callq 0x20b0
addq $0x28, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2e8f
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/dlist.c
// Function: list_release
void list_release(list *list, int nofree)
{
    unsigned long len;
    list_node *current, *next;

    current = list->head;
    len = list->len;
    while(len--) {
        next = current->next;
        if (AL_FREE == nofree)
            free(current->value);
        free(current);
        current = next;
    }
    free(list);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movq (%rdi), %r15
movq 0x10(%rdi), %r12
subq $0x1, %r12
jb 0x314a
movq 0x8(%r15), %r13
testl %r14d, %r14d
jne 0x313d
movq 0x10(%r15), %rdi
callq 0x2030
movq %r15, %rdi
callq 0x2030
movq %r13, %r15
jmp 0x3125
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2030
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/dlist.c
// Function: list_add_node_head
list *list_add_node_head(list *list, void *value)
{
    list_node *node;

    if ((node = malloc(sizeof(*node))) == NULL)
        return NULL;
    node->value = value;
    if (list->len == 0) {
        list->head = list->tail = node;
        node->prev = node->next = NULL;
    } else {
        node->prev = NULL;
        node->next = list->head;
        list->head->prev = node;
        list->head = node;
    }
    list->len++;
    return list;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x18
popq %rdi
callq 0x22a0
testq %rax, %rax
je 0x3193
movq %r14, 0x10(%rax)
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0x3197
andq $0x0, (%rax)
movq (%rbx), %rdx
movq %rax, (%rdx)
jmp 0x31a1
xorl %ebx, %ebx
jmp 0x31af
movq %rax, 0x8(%rbx)
andq $0x0, (%rax)
xorl %edx, %edx
movq %rax, (%rbx)
movq %rdx, 0x8(%rax)
incq %rcx
movq %rcx, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/dlist.c
// Function: list_add_node_tail
list *list_add_node_tail(list *list, void *value)
{
    list_node *node;

    if ((node = malloc(sizeof(*node))) == NULL)
        return NULL;
    node->value = value;
    if (list->len == 0) {
        list->head = list->tail = node;
        node->prev = node->next = NULL;
    } else {
        node->prev = list->tail;
        node->next = NULL;
        list->tail->next = node;
        list->tail = node;
    }
    list->len++;
    return list;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x18
popq %rdi
callq 0x22a0
testq %rax, %rax
je 0x31f1
movq %r14, 0x10(%rax)
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0x31f5
movq 0x8(%rbx), %rdx
andq $0x0, 0x8(%rax)
movq %rax, 0x8(%rdx)
movq %rax, 0x8(%rbx)
jmp 0x3203
xorl %ebx, %ebx
jmp 0x320d
movq %rax, 0x8(%rbx)
movq %rax, (%rbx)
andq $0x0, 0x8(%rax)
xorl %edx, %edx
movq %rdx, (%rax)
incq %rcx
movq %rcx, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/dlist.c
// Function: list_insert_node
list *list_insert_node(list *list, list_node *old_node, void *value, int after) {
    list_node *node;

    if ((node = malloc(sizeof(*node))) == NULL)
        return NULL;
    node->value = value;
    if (after) {
        node->prev = old_node;
        node->next = old_node->next;
        if (list->tail == old_node) {
            list->tail = node;
        }
    } else {
        node->next = old_node;
        node->prev = old_node->prev;
        if (list->head == old_node) {
            list->head = node;
        }
    }
    if (node->prev != NULL) {
        node->prev->next = node;
    }
    if (node->next != NULL) {
        node->next->prev = node;
    }
    list->len++;
    return list;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %r15d
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x18
popq %rdi
callq 0x22a0
testq %rax, %rax
je 0x325c
movq %r12, 0x10(%rax)
testl %r15d, %r15d
je 0x3260
movq %r14, (%rax)
movq 0x8(%r14), %rcx
movq %rcx, 0x8(%rax)
cmpq %r14, 0x8(%rbx)
jne 0x3257
movq %rax, 0x8(%rbx)
movq %r14, %rcx
jmp 0x3277
xorl %ebx, %ebx
jmp 0x328b
movq %r14, 0x8(%rax)
movq (%r14), %rcx
movq %rcx, (%rax)
cmpq %r14, (%rbx)
jne 0x3272
movq %rax, (%rbx)
testq %rcx, %rcx
je 0x3284
movq %rax, 0x8(%rcx)
movq 0x8(%rax), %r14
testq %r14, %r14
je 0x3287
movq %rax, (%r14)
incq 0x10(%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/dlist.c
// Function: list_del_node
void list_del_node(list *list, list_node *node, int nofree)
{
    if (node->prev)
        node->prev->next = node->next;
    else
        list->head = node->next;
    if (node->next)
        node->next->prev = node->prev;
    else
        list->tail = node->prev;
    if(AL_FREE == nofree)
        free(node->value);
    free(node);
    list->len--;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
leaq 0x8(%rax), %rcx
testq %rax, %rax
cmoveq %rdi, %rcx
movq 0x8(%rsi), %rsi
movq %rsi, (%rcx)
leaq 0x8(%rdi), %rcx
testq %rsi, %rsi
cmovneq %rsi, %rcx
movq %rax, (%rcx)
testl %edx, %edx
jne 0x32d4
movq 0x10(%r14), %rdi
callq 0x2030
movq %r14, %rdi
callq 0x2030
decq 0x10(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/dlist.c
// Function: list_next
list_node *list_next(list_iter *iter)
{
    list_node *current = iter->next;

    if (current != NULL) {
        if (iter->direction == AL_START_HEAD)
            iter->next = current->next;
        else
            iter->next = current->prev;
    }
    return current;
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x335f
pushq %rbp
movq %rsp, %rbp
xorl %ecx, %ecx
cmpl $0x0, 0x8(%rdi)
sete %cl
movq (%rax,%rcx,8), %rcx
movq %rcx, (%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/dlist.c
// Function: list_search_key
list_node *list_search_key(list *list, void *key, int len)
{
    list_iter *iter;
    list_node *node;

    iter = list_get_iterator(list, AL_START_HEAD);
    while((node = list_next(iter)) != NULL) {
        if (len > 0) {
            if (memcmp(node->value, key, len) == 0) {
                list_release_iterator(iter);
                return node;
            }
        } else {
            if (key == node->value) {
                list_release_iterator(iter);
                return node;
            }
        }
    }
    list_release_iterator(iter);
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
xorl %esi, %esi
callq 0x32e5
movq %rax, %r15
movl %ebx, %r12d
movq %r15, %rdi
callq 0x3342
movq %rax, %r13
testq %rax, %rax
je 0x33ae
movq 0x10(%r13), %rdi
testl %ebx, %ebx
jle 0x33a9
movq %r14, %rsi
movq %r12, %rdx
callq 0x22c0
testl %eax, %eax
jne 0x3380
jmp 0x33ae
cmpq %r14, %rdi
jne 0x3380
movq %r15, %rdi
callq 0x2030
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/dlist.c
// Function: list_index
list_node *list_index(list *list, long index) {
    list_node *n;

    if (index < 0) {
        index = (-index)-1;
        n = list->tail;
        while(index-- && n) n = n->prev;
    } else {
        n = list->head;
        while(index-- && n) n = n->next;
    }
    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
testq %rsi, %rsi
js 0x33e8
movq (%rax), %rax
addq $-0x1, %rsi
jae 0x33ff
testq %rax, %rax
je 0x33ff
addq $0x8, %rax
jmp 0x33d4
addq $0x8, %rax
incq %rsi
movq (%rax), %rax
testq %rsi, %rsi
je 0x33ff
incq %rsi
testq %rax, %rax
jne 0x33ef
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/dlist.c
// Function: list_rotate
void list_rotate(list *list) {
    list_node *tail = list->tail;

    if (list_length(list) <= 1) return;

    /* Detach current tail */
    list->tail = tail->prev;
    list->tail->next = NULL;
    /* Move it as head */
    list->head->prev = tail;
    tail->prev = NULL;
    tail->next = list->head;
    list->head = tail;
}

// Assembly:
cmpq $0x2, 0x10(%rdi)
jb 0x342e
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rax
movq (%rax), %rcx
movq %rcx, 0x8(%rdi)
andq $0x0, 0x8(%rcx)
movq (%rdi), %rcx
movq %rax, (%rcx)
andq $0x0, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, (%rdi)
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/iniconf.c
// Function: ini_destroy
int ini_destroy(ini_conf_t* ini)
{
    dict_iterator* it = dict_get_safe_iterator(ini);
    dict_entry* de = NULL;
    while((de = dict_next(it)) != NULL) {
        dict* v = (dict*)dict_get_entry_val(de);
        dict_delete_no_free(ini, de->key, de->keylen);

        free(de->key);

        dict_release(v);
    }
    dict_release_iterator(it);
    dict_release(ini);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x2caa
movq %rax, %r14
movq %r14, %rdi
callq 0x2cbc
testq %rax, %rax
je 0x347b
movq %rax, %r15
movq 0x10(%rax), %r12
movq 0x8(%rax), %rsi
movl (%rax), %edx
movq %rbx, %rdi
callq 0x2bae
movq 0x8(%r15), %rdi
callq 0x2030
movq %r12, %rdi
callq 0x2c35
jmp 0x3446
movq %r14, %rdi
callq 0x2d45
movq %rbx, %rdi
callq 0x2c35
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/iniconf.c
// Function: ini_insert_sec
ini_sec_t* ini_insert_sec(ini_conf_t* ini, const char* key)
{
    if (!ini || !key)
        return NULL ;

    int len = strlen(key);
    char* k = (char*)malloc(len + 1);
    strcpy(k, key);

    dict* v = dict_create(NULL);

    if(dict_add(ini, k, len, v, sizeof(v)) == DICT_OK){
        return v;
    }

    dict_release(v);

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x3842
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2130
movq %rax, %r15
incl %eax
movslq %eax, %rdi
callq 0x22a0
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x2090
xorl %edi, %edi
callq 0x256a
movq %rax, %r14
pushq $0x8
popq %r8
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
movq %rax, %rcx
callq 0x27ec
testl %eax, %eax
je 0x3845
movq %r14, %rdi
callq 0x2c35
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/iniconf.c
// Function: ini_insert_val
int ini_insert_val(ini_sec_t* sec, const char* key, const char* val)
{
    if (!sec || !key || !val)
        return -1 ;

    int klen = strlen(key);
    char* k = (char*)malloc(klen + 1);
    strcpy(k, key);

    int vlen = strlen(val);
    char* v = (char*)malloc(vlen + 1);
    strcpy(v, val);

    if(dict_add(sec, k, klen, v, vlen) == DICT_OK) {
        return 0;
    }

    return -1;
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
testq %rdx, %rdx
sete %al
orb %cl, %al
jne 0x38f8
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2130
movq %rax, -0x30(%rbp)
leal 0x1(%rax), %ecx
movslq %ecx, %rdi
callq 0x22a0
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
callq 0x2090
movq %r14, %rdi
callq 0x2130
movq %rax, %r12
incl %eax
movslq %eax, %rdi
callq 0x22a0
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x2090
movq %rbx, %rdi
movq %r13, %rsi
movq -0x30(%rbp), %rdx
movq %r15, %rcx
movl %r12d, %r8d
callq 0x27ec
movl %eax, %ecx
xorl %eax, %eax
negl %ecx
sbbl %eax, %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/buf1024[P]mysch/iniconf.c
// Function: ini_save
int ini_save(ini_conf_t* ini, const char* file)
{
    if (!ini || !file)
        return -1;

    int fd = open(file, O_RDWR | O_CREAT,
            S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
    if (fd == -1)
        return -1;

    dict_iterator* it = dict_get_iterator(ini);
    dict_entry* de = NULL;
    while((de = dict_next(it)) != NULL) {
        const char* k = (const char*)dict_get_entry_key(de);
        ini_sec_t* v = (ini_sec_t*)dict_get_entry_val(de);


        write(fd, "[", 1);
        write(fd, k, strlen(k));
        write(fd, "]", 1);
        write(fd, "\n", 1);

        int ret = ini_save_sec(v, fd);
        if(ret < 0){
            close(fd);
            return -1;
        }
    }
    dict_release_iterator(it);
    close(fd);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
pushq $-0x1
popq %r15
orb %al, %cl
jne 0x3a66
movq %rdi, %rbx
pushq $0x42
popq %rax
movq %rsi, %rdi
movl %eax, %esi
movl $0x1b4, %edx            # imm = 0x1B4
xorl %eax, %eax
callq 0x22f0
cmpl $-0x1, %eax
je 0x3a66
movl %eax, %r14d
movq %rbx, %rdi
callq 0x2c76
movq %rax, -0x30(%rbp)
pushq $0x1
popq %r13
movq -0x30(%rbp), %rdi
callq 0x2cbc
testq %rax, %rax
je 0x3a4c
movq 0x8(%rax), %rbx
movq 0x10(%rax), %r15
movl %r14d, %edi
leaq 0x37bf(%rip), %rsi      # 0x7138
movq %r13, %rdx
callq 0x20f0
movq %rbx, %rdi
callq 0x2130
movl %r14d, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x20f0
movl %r14d, %edi
leaq 0x3832(%rip), %rsi      # 0x71d3
movq %r13, %rdx
callq 0x20f0
movl %r14d, %edi
leaq 0x37e6(%rip), %rsi      # 0x7199
movq %r13, %rdx
callq 0x20f0
testl %r14d, %r14d
js 0x3a5a
testq %r15, %r15
je 0x3a5a
movq %r15, %rdi
callq 0x2c76
movq %rax, %r15
movq %r15, %rdi
callq 0x2cbc
testq %rax, %rax
je 0x3a3f
movq 0x8(%rax), %rbx
movq 0x10(%rax), %r12
movq %rbx, %rdi
callq 0x2130
movl %r14d, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x20f0
movl %r14d, %edi
leaq 0x3733(%rip), %rsi      # 0x7140
movq %r13, %rdx
callq 0x20f0
movq %r12, %rdi
callq 0x2130
movl %r14d, %edi
movq %r12, %rsi
movq %rax, %rdx
callq 0x20f0
movl %r14d, %edi
leaq 0x3764(%rip), %rsi      # 0x7199
movq %r13, %rdx
callq 0x20f0
jmp 0x39d8
movq %r15, %rdi
callq 0x2d45
jmp 0x3955
movq -0x30(%rbp), %rdi
callq 0x2d45
xorl %r15d, %r15d
jmp 0x3a5e
pushq $-0x1
popq %r15
movl %r14d, %edi
callq 0x21c0
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/iniconf.c
// Function: ini_dump
int ini_dump(ini_conf_t* ini, char* buf, size_t len)
{
    if (!ini || !buf || !ini)
        return -1;
    size_t wlen = 0;
    dict_iterator* it = dict_get_iterator(ini);
    dict_entry* de = NULL;
    while((de = dict_next(it)) != NULL) {
        const char* k = (const char*)dict_get_entry_key(de);
        ini_sec_t* v = (ini_sec_t*)dict_get_entry_val(de);

        if(wlen >= len) return -1;

        wlen += snprintf(buf + wlen, len - wlen, "[%s]\n", k);
        if(wlen >= len) return -1;

        int ret = ini_save_sec_buf(v, buf + wlen, len - wlen);
        if(ret <= 0) return -1;
        wlen += ret;
    }
    dict_release_iterator(it);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r12
testq %rdi, %rdi
sete %dl
testq %rsi, %rsi
sete %cl
pushq $-0x1
popq %rax
orb %dl, %cl
jne 0x3bfe
movq %rsi, %r13
callq 0x2c76
movq %rax, %rbx
leaq 0x3685(%rip), %r15      # 0x713a
xorl %r14d, %r14d
movq %r12, -0x48(%rbp)
movq %r13, -0x40(%rbp)
movq %rax, -0x38(%rbp)
movq %rbx, %rdi
callq 0x2cbc
testq %rax, %rax
je 0x3c0d
movq %r12, %rsi
subq %r14, %rsi
jbe 0x3bfb
movq 0x10(%rax), %rbx
movq 0x8(%rax), %rcx
leaq (%r14,%r13), %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2170
cltq
addq %r14, %rax
movq %r12, %r15
subq %rax, %r15
jbe 0x3bfb
testq %rbx, %rbx
je 0x3bfb
movq %rax, -0x50(%rbp)
addq %rax, %r13
movq %rbx, %rdi
callq 0x2c76
movq %rax, -0x30(%rbp)
xorl %ebx, %ebx
movq -0x30(%rbp), %rdi
callq 0x2cbc
testq %rax, %rax
je 0x3bd0
movq 0x8(%rax), %rcx
movq 0x10(%rax), %r14
leaq (%rbx,%r13), %rdi
movq %r15, %rsi
subq %rbx, %rsi
leaq 0x3667(%rip), %rdx      # 0x71b8
xorl %eax, %eax
callq 0x2170
movslq %eax, %r12
addq %rbx, %r12
movq %r15, %rsi
subq %r12, %rsi
jbe 0x3bfb
leaq (%r12,%r13), %rdi
leaq 0x35cb(%rip), %rdx      # 0x7140
xorl %eax, %eax
callq 0x2170
movslq %eax, %rbx
addq %r12, %rbx
movq %r15, %rsi
subq %rbx, %rsi
jbe 0x3bfb
leaq (%rbx,%r13), %rdi
leaq 0x3623(%rip), %rdx      # 0x71b8
movq %r14, %rcx
xorl %eax, %eax
callq 0x2170
movslq %eax, %r14
addq %rbx, %r14
movq %r15, %rsi
subq %r14, %rsi
jbe 0x3bfb
leaq (%r14,%r13), %rdi
leaq 0x35e1(%rip), %rdx      # 0x7199
xorl %eax, %eax
callq 0x2170
movslq %eax, %rbx
addq %r14, %rbx
cmpq %r15, %rbx
jb 0x3b26
jmp 0x3bfb
movq -0x30(%rbp), %rdi
callq 0x2d45
movl %ebx, %r14d
addq -0x50(%rbp), %r14
testl %ebx, %ebx
movq -0x48(%rbp), %r12
movq -0x40(%rbp), %r13
movq -0x38(%rbp), %rbx
leaq 0x3545(%rip), %r15      # 0x713a
jg 0x3ac4
pushq $-0x1
popq %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x2d45
xorl %eax, %eax
jmp 0x3bfe
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/iniconf.c
// Function: ini_delete_sec
int ini_delete_sec(ini_conf_t* ini, const char* key)
{
    if (!ini || !key)
        return -1 ;

    int len = strlen(key);

    dict* v = (dict*)dict_fetch_value(ini, key, len);

    if(!v) {
        return -1;
    }

    dict_release(v);
    dict_delete(ini, key, len);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
pushq $-0x1
popq %r15
orb %al, %cl
jne 0x3c75
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x2130
movq %rax, %r12
movq %r14, %rdi
movq %rbx, %rsi
movl %r12d, %edx
callq 0x2c5e
testq %rax, %rax
je 0x3c75
movq %rax, %rdi
callq 0x2c35
movq %r14, %rdi
movq %rbx, %rsi
movl %r12d, %edx
callq 0x2a8d
xorl %r15d, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/log.c
// Function: log_get_level
int log_get_level(const char* lvl)
{
    if (lvl) {
        if (strcasecmp(lvl, "all") == 0) {
            return LOG_ALL;
        } else if (strcasecmp(lvl, "debug") == 0) {
            return LOG_DEBUG;
        } else if (strcasecmp(lvl, "info") == 0) {
            return LOG_INFO;
        } else if (strcasecmp(lvl, "warn") == 0) {
            return LOG_WARN;
        } else if (strcasecmp(lvl, "error") == 0) {
            return LOG_ERROR;
        } else if (strcasecmp(lvl, "fatal") == 0) {
            return LOG_FATAL;
        } else if (strcasecmp(lvl, "off") == 0) {
            return LOG_OFF;
        }
    }

    return LOG_ALL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x3dcc
movq %rdi, %rbx
leaq 0x33f1(%rip), %rsi      # 0x7142
callq 0x2040
testl %eax, %eax
je 0x3dcc
leaq 0x33e5(%rip), %rsi      # 0x7146
movq %rbx, %rdi
callq 0x2040
testl %eax, %eax
je 0x3dd5
leaq 0x33d8(%rip), %rsi      # 0x714c
movq %rbx, %rdi
callq 0x2040
testl %eax, %eax
je 0x3dda
leaq 0x33ca(%rip), %rsi      # 0x7151
movq %rbx, %rdi
callq 0x2040
testl %eax, %eax
je 0x3de1
leaq 0x33bc(%rip), %rsi      # 0x7156
movq %rbx, %rdi
callq 0x2040
testl %eax, %eax
je 0x3de8
leaq 0x33af(%rip), %rsi      # 0x715c
movq %rbx, %rdi
callq 0x2040
testl %eax, %eax
je 0x3def
leaq 0x33a2(%rip), %rsi      # 0x7162
movq %rbx, %rdi
callq 0x2040
testl %eax, %eax
je 0x3df6
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
pushq $0x64
popq %rax
jmp 0x3dce
movl $0xc8, %eax
jmp 0x3dce
movl $0x12c, %eax            # imm = 0x12C
jmp 0x3dce
movl $0x190, %eax            # imm = 0x190
jmp 0x3dce
movl $0x1f4, %eax            # imm = 0x1F4
jmp 0x3dce
movl $0x258, %eax            # imm = 0x258
jmp 0x3dce
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/log.c
// Function: log_reg_callback
int log_reg_callback(int lvl,
        log_callback_int_t init_cb,
        log_callback_log_t log_cb,
        log_callback_uninit_t uninit_cb,
        log_callback_flush_t flush_cb,
        void* args)
{
    pthread_mutex_lock(&_ctx_mutex);

    struct call_back* cb = (struct call_back*)malloc(sizeof(struct call_back));
    if(cb){

        memset(cb, 0, sizeof(*cb));

        cb->level = lvl;//log_get_level(lvl);
        cb->init_cb_fun = init_cb;
        cb->log_cb_fun = log_cb;
        cb->uninit_cb_fun = uninit_cb;
        cb->flush_cb_fun = flush_cb;
        cb->args = args;
        cb->next = 0;

        if(_context.cb == 0){
            _context.cb = cb;
        }else{
            struct call_back* iter_cb = _context.cb;
            while(iter_cb->next){
                iter_cb = iter_cb->next;
            }
            iter_cb->next = cb;
        }
    }
    pthread_mutex_unlock(&_ctx_mutex);

    return LOG_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, -0x30(%rbp)
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movl %edi, %ebx
leaq 0x73dc(%rip), %rdi      # 0xb200
callq 0x23b0
pushq $0x1
popq %rdi
pushq $0x38
popq %rsi
callq 0x21f0
testq %rax, %rax
je 0x3e7b
movl %ebx, (%rax)
movq %r13, 0x8(%rax)
movq %r12, 0x10(%rax)
movq %r15, 0x18(%rax)
movq %r14, 0x20(%rax)
movq -0x30(%rbp), %rcx
movq %rcx, 0x28(%rax)
movq 0x73ce(%rip), %rdx      # 0xb228
testq %rdx, %rdx
je 0x3e71
movq %rdx, %rcx
movq 0x30(%rdx), %rdx
testq %rdx, %rdx
jne 0x3e5f
addq $0x30, %rcx
jmp 0x3e78
leaq 0x73b0(%rip), %rcx      # 0xb228
movq %rax, (%rcx)
leaq 0x737e(%rip), %rdi      # 0xb200
callq 0x2290
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/log.c
// Function: log_start
int log_start()
{
    struct call_back* cb = _context.cb;
    while(cb){
        if (cb->init_cb_fun) {
            if (cb->init_cb_fun(cb->args) == LOG_FAIL) {
                fprintf(stderr, "fail to init call back!\n");
                return LOG_FAIL;
            }
        }
        cb = cb->next;
    }
    return LOG_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x7383(%rip), %rbx      # 0xb228
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x3ec7
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x3ec1
movq 0x28(%rbx), %rdi
callq *%rax
cmpl $-0x1, %eax
je 0x3ed0
addq $0x30, %rbx
jmp 0x3ea5
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0x7121(%rip), %rax      # 0xaff8
movq (%rax), %rcx
leaq 0x3285(%rip), %rdi      # 0x7166
pushq $0x18
popq %rsi
pushq $0x1
popq %rdx
callq 0x2350
pushq $-0x1
popq %rax
jmp 0x3ec9
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/log.c
// Function: log_flush
void log_flush()
{

    pthread_mutex_lock(&_ctx_mutex);
    struct call_back* cb = _context.cb;
    while (cb) {
        if (cb->flush_cb_fun) {
            if (cb->flush_cb_fun(cb->args) == LOG_FAIL) {
                fprintf(stderr, "fail to flush log message!\n");
            }
        }
        cb = cb->next;
    }
    pthread_mutex_unlock(&_ctx_mutex);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x72d3(%rip), %rdi      # 0xb200
callq 0x23b0
leaq 0x72ef(%rip), %r12      # 0xb228
movq 0x70b8(%rip), %r13      # 0xaff8
leaq 0x3238(%rip), %rbx      # 0x717f
pushq $0x1b
popq %r14
pushq $0x1
popq %r15
movq (%r12), %r12
testq %r12, %r12
je 0x3f88
movq 0x20(%r12), %rax
testq %rax, %rax
je 0x3f6e
movq 0x28(%r12), %rdi
callq *%rax
cmpl $-0x1, %eax
je 0x3f74
addq $0x30, %r12
jmp 0x3f4f
movq (%r13), %rcx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2350
jmp 0x3f6e
leaq 0x7271(%rip), %rdi      # 0xb200
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2290
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/log.c
// Function: log_debug
void log_debug(const char* format, ...)
{
    va_list ap;

    pthread_mutex_lock(&_ctx_mutex);
    va_start(ap, format);
    log_message(LOG_DEBUG, format, ap);
    va_end(ap);
    pthread_mutex_unlock(&_ctx_mutex);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %rbx
leaq -0xe0(%rbp), %r15
movq %rsi, 0x8(%r15)
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0x3ffd
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
leaq 0x71fc(%rip), %r14      # 0xb200
movq %r14, %rdi
callq 0x23b0
movabsq $0x3000000008, %rax     # imm = 0x3000000008
leaq -0x30(%rbp), %rdx
movq %rax, (%rdx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rdx)
movq %r15, 0x10(%rdx)
pushq $0x64
popq %rdi
movq %rbx, %rsi
callq 0x404a
movq %r14, %rdi
callq 0x2290
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/log.c
// Function: log_info
void log_info (const char* format, ...)
{
    va_list ap;

    pthread_mutex_lock(&_ctx_mutex);
    va_start(ap, format);
    log_message(LOG_INFO, format, ap);
    va_end(ap);
    pthread_mutex_unlock(&_ctx_mutex);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %rbx
leaq -0xe0(%rbp), %r15
movq %rsi, 0x8(%r15)
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0x42c1
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
leaq 0x6f38(%rip), %r14      # 0xb200
movq %r14, %rdi
callq 0x23b0
movabsq $0x3000000008, %rax     # imm = 0x3000000008
leaq -0x30(%rbp), %rdx
movq %rax, (%rdx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rdx)
movq %r15, 0x10(%rdx)
movl $0xc8, %edi
movq %rbx, %rsi
callq 0x404a
movq %r14, %rdi
callq 0x2290
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/log.c
// Function: log_warn
void log_warn (const char* format, ...)
{
    va_list ap;

    pthread_mutex_lock(&_ctx_mutex);
    va_start(ap, format);
    log_message(LOG_WARN, format, ap);
    va_end(ap);
    pthread_mutex_unlock(&_ctx_mutex);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %rbx
leaq -0xe0(%rbp), %r15
movq %rsi, 0x8(%r15)
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0x436b
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
leaq 0x6e8e(%rip), %r14      # 0xb200
movq %r14, %rdi
callq 0x23b0
movabsq $0x3000000008, %rax     # imm = 0x3000000008
leaq -0x30(%rbp), %rdx
movq %rax, (%rdx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rdx)
movq %r15, 0x10(%rdx)
movl $0x12c, %edi            # imm = 0x12C
movq %rbx, %rsi
callq 0x404a
movq %r14, %rdi
callq 0x2290
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/log.c
// Function: log_fatal
void log_fatal(const char* format, ...)
{
    va_list ap;

    pthread_mutex_lock(&_ctx_mutex);
    va_start(ap, format);
    log_message(LOG_FATAL, format, ap);
    va_end(ap);
    pthread_mutex_unlock(&_ctx_mutex);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %rbx
leaq -0xe0(%rbp), %r15
movq %rsi, 0x8(%r15)
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0x44bf
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
leaq 0x6d3a(%rip), %r14      # 0xb200
movq %r14, %rdi
callq 0x23b0
movabsq $0x3000000008, %rax     # imm = 0x3000000008
leaq -0x30(%rbp), %rdx
movq %rax, (%rdx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rdx)
movq %r15, 0x10(%rdx)
movl $0x1f4, %edi            # imm = 0x1F4
movq %rbx, %rsi
callq 0x404a
movq %r14, %rdi
callq 0x2290
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/log.c
// Function: log_finish
int log_finish()
{
    log_flush();

    pthread_mutex_lock(&_ctx_mutex);

    struct call_back* cb = _context.cb;
    while(cb){
        struct call_back* tmp_cb = cb;
        if (cb->uninit_cb_fun) {
            if (cb->uninit_cb_fun(cb->args) == LOG_FAIL) {
                fprintf(stderr, "fail to uninit call back!\n");
            }
        }
        cb = cb->next;
        free(tmp_cb);
    }

    pthread_mutex_unlock(&_ctx_mutex);

    return LOG_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x3f18
leaq 0x6cd8(%rip), %rdi      # 0xb200
callq 0x23b0
movq 0x6cf4(%rip), %r15      # 0xb228
leaq 0x2c60(%rip), %rbx      # 0x719b
pushq $0x1a
popq %r14
pushq $0x1
popq %r12
testq %r15, %r15
je 0x4587
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x455c
movq 0x28(%r15), %rdi
callq *%rax
cmpl $-0x1, %eax
je 0x456d
movq 0x30(%r15), %r13
movq %r15, %rdi
callq 0x2030
movq %r13, %r15
jmp 0x4543
movq 0x6a84(%rip), %rax      # 0xaff8
movq (%rax), %rcx
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2350
jmp 0x455c
leaq 0x6c72(%rip), %rdi      # 0xb200
callq 0x2290
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/log.c
// Function: log_initialize_default
int log_initialize_default(int con_lvl, int file_lvl,
        char* file_path, char* prefix, int buf_size,
        int sw_time, int sw_size)
{
    log_clearup();

    if (log_initialize_console(con_lvl) == LOG_FAIL) {
        return LOG_FAIL;
    }

    if (log_initialize_file(file_lvl, file_path,
            prefix, buf_size, sw_time, sw_size) == LOG_FAIL) {
        return LOG_FAIL;
    }

    return log_start();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, -0x2c(%rbp)
movl %r8d, %r14d
movq %rcx, %r15
movq %rdx, %r12
movl 0x10(%rbp), %r13d
andq $0x0, 0x6c5d(%rip)      # 0xb228
movl %esi, %ebx
xorps %xmm0, %xmm0
movups %xmm0, 0x6c29(%rip)     # 0xb200
movups %xmm0, 0x6c32(%rip)     # 0xb210
andq $0x0, 0x6c3a(%rip)      # 0xb220
callq 0x462c
movl %ebx, %edi
movq %r12, %rsi
movq %r15, %rdx
movl %r14d, %ecx
movl -0x2c(%rbp), %r8d
movl %r13d, %r9d
callq 0x464a
cmpl $-0x1, %eax
je 0x461a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3e98
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/buf1024[P]mysch/log.c
// Function: log_initialize_file
int log_initialize_file(int file_lvl,
        char* file_path, char* prefix, int buf_size,
        int sw_time, int sw_size)
{
    if(!file_path || !prefix || buf_size <= 0) {
        return LOG_FAIL;
    }

    memset(&_file_log_ctx, 0, sizeof(_file_log_ctx));

    strncpy(_file_log_ctx.path, file_path, sizeof(_file_log_ctx.path) - 1);
    if(_file_log_ctx.path[strlen(_file_log_ctx.path) - 1] == '/') {
        _file_log_ctx.path[strlen(_file_log_ctx.path) - 1] = 0;
    }
    strncpy(_file_log_ctx.prefix, prefix, sizeof(_file_log_ctx.prefix) - 1);
    _file_log_ctx.buf_size = buf_size;
    _file_log_ctx.switch_size = sw_size;
    _file_log_ctx.switch_time = sw_time;
    _file_log_ctx.buf = malloc(sizeof(char)*buf_size);
    if(!_file_log_ctx.buf) {
        return LOG_FAIL;
    }
    memset(_file_log_ctx.buf, 0, sizeof(char)*buf_size);

    return log_reg_callback(file_lvl,
            log_file_init_callback_fun,
            log_file_log_callback_fun,
            log_file_uninit_callback_fun,
            log_file_flush_callback_fun,
            0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r15d
testq %rsi, %rsi
sete %al
testq %rdx, %rdx
sete %cl
orb %al, %cl
testl %r15d, %r15d
setle %al
orb %cl, %al
pushq $-0x1
popq %r14
jne 0x4739
movq %rdx, %rbx
movq %rsi, %r12
movl %r9d, -0x30(%rbp)
movl %r8d, -0x34(%rbp)
movl %edi, -0x2c(%rbp)
leaq 0x6b9a(%rip), %r13      # 0xb230
movl $0x338, %edx            # imm = 0x338
movq %r13, %rdi
xorl %esi, %esi
callq 0x21a0
movl $0xff, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x2070
movq %r13, %rdi
callq 0x2130
cmpb $0x2f, -0x1(%rax,%r13)
jne 0x46cb
movb $0x0, -0x1(%rax,%r13)
leaq 0x6c5e(%rip), %rdi      # 0xb330
movl $0xff, %edx
movq %rbx, %rsi
callq 0x2070
movl %r15d, 0x6e72(%rip)     # 0xb558
movl -0x30(%rbp), %eax
movl %eax, 0x6e59(%rip)      # 0xb548
movl -0x34(%rbp), %eax
movl %eax, 0x6e4c(%rip)      # 0xb544
movl %r15d, %esi
pushq $0x1
popq %rdi
callq 0x21f0
movq %rax, 0x6e46(%rip)      # 0xb550
testq %rax, %rax
je 0x4739
leaq 0x51(%rip), %rsi        # 0x4767
leaq 0x2d2(%rip), %rdx       # 0x49ef
leaq 0x380(%rip), %rcx       # 0x4aa4
leaq 0x4cc(%rip), %r8        # 0x4bf7
xorl %r14d, %r14d
movl -0x2c(%rbp), %edi
xorl %r9d, %r9d
callq 0x3dfd
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_O2/buf1024[P]mysch/log.c
// Function: log_file_log_callback_fun
int log_file_log_callback_fun(const char* log, int len, void* args)
{
    FILE* fp = _file_log_ctx.fp;
    if (fp == NULL ) {
        return LOG_FAIL;
    }

    if(log_file_switch(args) != LOG_SUCCESS) {
        return LOG_FAIL;
    }

    int m_size = len;

    if (m_size > (_file_log_ctx.buf_size - _file_log_ctx.w_pos)) {
        if (_file_log_ctx.w_pos > 0) {
            _file_log_ctx.w_size += fwrite(_file_log_ctx.buf, 1,
                    _file_log_ctx.w_pos, _file_log_ctx.fp);
            _file_log_ctx.w_pos = 0;
        }
        _file_log_ctx.w_size += fwrite(log, 1, m_size, _file_log_ctx.fp);
    } else {
        memcpy(_file_log_ctx.buf + _file_log_ctx.w_pos, log, m_size);
        _file_log_ctx.w_pos += m_size;
        _file_log_ctx.w_size += m_size;
    }
    return LOG_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
pushq $-0x1
popq %r15
cmpq $0x0, 0x6b33(%rip)      # 0xb538
je 0x4a96
movl %esi, %ebx
movq %rdi, %r14
callq 0x4c66
testl %eax, %eax
jne 0x4a96
movl 0x6b39(%rip), %eax      # 0xb558
movl 0x6b3b(%rip), %edx      # 0xb560
subl %edx, %eax
cmpl %ebx, %eax
jge 0x4a6c
testl %edx, %edx
jle 0x4a52
movq 0x6b1a(%rip), %rdi      # 0xb550
movq 0x6afb(%rip), %rcx      # 0xb538
pushq $0x1
popq %rsi
callq 0x2350
addl %eax, 0x6b11(%rip)      # 0xb55c
andl $0x0, 0x6b0e(%rip)      # 0xb560
movslq %ebx, %rdx
movq 0x6adc(%rip), %rcx      # 0xb538
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x2350
movq %rax, %rbx
jmp 0x4a87
movslq %edx, %rdi
addq 0x6ada(%rip), %rdi      # 0xb550
movslq %ebx, %rdx
movq %r14, %rsi
callq 0x2250
addl %ebx, 0x6ad9(%rip)      # 0xb560
addl 0x6acf(%rip), %ebx      # 0xb55c
movl %ebx, 0x6ac9(%rip)      # 0xb55c
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq