LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/buf1024[P]mysch/dict.c
// Function: dict_resize
int dict_resize(dict *d)
{
    int minimal;

    if (!dict_can_resize || dict_is_rehashing(d))
        return DICT_ERR;
    minimal = d->ht[0].used;
    if (minimal < DICT_HT_INITIAL_SIZE)
        minimal = DICT_HT_INITIAL_SIZE;
    return dict_expand(d, minimal);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpb $0x0, 0x9ac1(%rip)      # 0xc1fc
jne 0x2743
cmpl $-0x1, 0x48(%rdi)
je 0x274a
movl $0x1, %eax
popq %rbp
retq
movl 0x20(%rdi), %eax
cmpl $0x5, %eax
movl $0x4, %esi
cmovgel %eax, %esi
popq %rbp
jmp 0x275e
// File: /workspace/github_c_makefile_star2_O1/buf1024[P]mysch/dict.c
// Function: dict_expand
int dict_expand(dict *d, unsigned long size)
{
    dictht n;                   /* the new hashtable */
    unsigned long realsize = _dict_next_power(size);

    /* the size is invalid if it is smaller than the number of
     * elements already inside the hashtable */
    if (dict_is_rehashing(d) || d->ht[0].used > size)
        return DICT_ERR;

    /* Allocate the new hashtable and initialize all pointers to NULL */
    n.size = realsize;
    n.sizemask = realsize - 1;
    n.table = (dict_entry**)calloc(1, realsize * sizeof(dict_entry *));
    n.used = 0;

    /* Is this the first initialization? If so it's not really a rehashing
     * we just set the first hash table so that it can accept keys. */
    if (d->ht[0].table == NULL)
    {
        d->ht[0] = n;
        return DICT_OK;
    }

    /* Prepare a second hash table for incremental rehashing */
    d->ht[1] = n;
    d->rehashidx = 0;
    return DICT_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movabsq $0x7ffffffffffffffe, %r14 # imm = 0x7FFFFFFFFFFFFFFE
cmpq %r14, %rsi
jbe 0x277f
incq %r14
jmp 0x278f
movl $0x4, %eax
movq %rax, %r14
addq %rax, %rax
cmpq %rsi, %r14
jb 0x2784
movl $0x1, %eax
cmpl $-0x1, 0x48(%rbx)
jne 0x27f0
cmpq %rsi, 0x20(%rbx)
ja 0x27f0
leaq -0x1(%r14), %r15
leaq (,%r14,8), %rsi
movl $0x1, %edi
callq 0x21f0
cmpq $0x0, 0x8(%rbx)
je 0x27da
movq %rax, 0x28(%rbx)
movq %r14, 0x30(%rbx)
movq %r15, 0x38(%rbx)
movq $0x0, 0x40(%rbx)
movl $0x0, 0x48(%rbx)
jmp 0x27ee
movq %rax, 0x8(%rbx)
movq %r14, 0x10(%rbx)
movq %r15, 0x18(%rbx)
movq $0x0, 0x20(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/buf1024[P]mysch/dict.c
// Function: dict_rehash
int dict_rehash(dict *d, int n)
{
    if (!dict_is_rehashing(d))
        return 0;

    while (n--)
    {
        dict_entry *de, *nextde;

        /* Check if we already rehashed the whole table... */
        if (d->ht[0].used == 0)
        {
            free(d->ht[0].table);
            d->ht[0] = d->ht[1];
            _dict_reset(&d->ht[1]);
            d->rehashidx = -1;
            return 0;
        }

        /* Note that rehashidx can't overflow as we are sure there are more
         * elements because ht[0].used != 0 */
        while (d->ht[0].table[d->rehashidx] == NULL)
            d->rehashidx++;
        de = d->ht[0].table[d->rehashidx];
        /* Move all the keys in this bucket from the old to the new hash HT */
        while (de)
        {
            unsigned int h;

            nextde = de->next;
            /* Get the index in the new hash table */
            h = dict_gen_hash_function((const unsigned char*)de->key, de->keylen) & d->ht[1].sizemask;
            de->next = d->ht[1].table[h];
            d->ht[1].table[h] = de;
            d->ht[0].used--;
            d->ht[1].used++;
            de = nextde;
        }
        d->ht[0].table[d->rehashidx] = NULL;
        d->rehashidx++;
    }
    return 1;
}

// Assembly:
cmpl $-0x1, 0x48(%rdi)
je 0x292e
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x8(%rdi), %rax
movq %rax, -0x30(%rbp)
leaq 0x28(%rdi), %rax
movq %rax, -0x38(%rbp)
subl $0x1, %ebx
jb 0x2931
movq 0x8(%r14), %rdi
movq 0x20(%r14), %r15
testq %r15, %r15
je 0x28f3
movl 0x48(%r14), %ecx
movslq %ecx, %rax
movq (%rdi,%rax,8), %rdx
testq %rdx, %rdx
movq %r15, -0x40(%rbp)
jne 0x286c
movq 0x8(%rdi,%rax,8), %rdx
incq %rax
testq %rdx, %rdx
je 0x2859
movl %eax, 0x48(%r14)
movl %eax, %ecx
movl 0x38(%r14), %esi
movq 0x20(%r14), %rdi
movq 0x40(%r14), %r8
movq 0x18(%rdx), %r9
movl (%rdx), %r11d
testq %r11, %r11
je 0x28ad
movq 0x8(%rdx), %r15
movl $0x1505, %r10d          # imm = 0x1505
xorl %r12d, %r12d
movl %r10d, %r13d
shll $0x5, %r13d
addl %r10d, %r13d
movzbl (%r15,%r12), %r10d
addl %r13d, %r10d
incq %r12
cmpl %r12d, %r11d
jne 0x2891
jmp 0x28b3
movl $0x1505, %r10d          # imm = 0x1505
andl %esi, %r10d
movq 0x28(%r14), %r11
movq (%r11,%r10,8), %r15
movq %r15, 0x18(%rdx)
movq %rdx, (%r11,%r10,8)
decq %rdi
movq %rdi, 0x20(%r14)
incq %r8
movq %r8, 0x40(%r14)
movq %r9, %rdx
testq %r9, %r9
jne 0x2878
movq -0x30(%rbp), %rdx
movq (%rdx), %rdx
movq $0x0, (%rdx,%rax,8)
incl %ecx
movq -0x40(%rbp), %r15
jmp 0x291d
callq 0x2030
movq -0x38(%rbp), %rcx
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movq -0x30(%rbp), %rax
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rcx)
movups %xmm0, 0x10(%rcx)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ecx, 0x48(%r14)
testq %r15, %r15
jne 0x282b
xorl %eax, %eax
jmp 0x2936
xorl %eax, %eax
retq
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/buf1024[P]mysch/dict.c
// Function: dict_rehash_milliseconds
int dict_rehash_milliseconds(dict *d, int ms)
{
    long long start = time_in_milliseconds();
    int rehashes = 0;

    while (dict_rehash(d, 100))
    {
        rehashes += 100;
        if (time_in_milliseconds() - start > ms)
            break;
    }
    return rehashes;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %r13d
movq %rdi, %r14
xorl %ebx, %ebx
leaq -0x38(%rbp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x2190
movabsq $-0x20c49ba5e353f7cf, %rax # imm = 0xDF3B645A1CAC0831
imulq 0x8(%r15)
movq %rdx, %r12
movq (%r15), %r15
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %r12
addq %rax, %r12
movslq %r13d, %r13
movq %r14, %rdi
movl $0x64, %esi
callq 0x27fb
testl %eax, %eax
je 0x2a29
addl $0x64, %ebx
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
callq 0x2190
movq -0x38(%rbp), %rcx
subq %r15, %rcx
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq -0x30(%rbp)
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rdx
addq %rax, %rdx
addq %r12, %rdx
imulq $0x3e8, %rcx, %rax      # imm = 0x3E8
addq %rdx, %rax
cmpq %r13, %rax
jle 0x29d5
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/buf1024[P]mysch/dict.c
// Function: dict_replace
int dict_replace(dict *d, void *key, int keylen, void *val, int vallen)
{
    dict_entry *entry, auxentry;

    /* Try to add the element. If the key
     * does not exists dictAdd will suceed. */
    if (dict_add(d, key, keylen, val, vallen) == DICT_OK)
        return 1;
    /* It already exists, get the entry */
    entry = dict_find(d, key, keylen);
    /* Free the old value and set the new one */
    /* Set the new value and free the old one. Note that it is important
     * to do that in this order, as the value may just be exactly the same
     * as the previous one. In this context, think to reference counting,
     * you want to increment (set), and then decrement (free), and not the
     * reverse. */
    auxentry = *entry;
    entry->val = val;
    entry->vallen = vallen;

    free(auxentry.val);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebx
movq %rcx, %r14
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %r13
callq 0x2a3a
testl %eax, %eax
je 0x2c57
movq %r13, %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x2c6b
movq 0x10(%rax), %rdi
movq %r14, 0x10(%rax)
movl %ebx, 0x4(%rax)
callq 0x2030
xorl %eax, %eax
jmp 0x2c5c
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 $0x28, %rsp
cmpq $0x0, 0x10(%rdi)
je 0x2d45
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
cmpl $-0x1, 0x48(%rdi)
je 0x2ca9
cmpl $0x0, 0x4c(%r15)
jne 0x2ca9
movq %r15, %rdi
movl $0x1, %esi
callq 0x27fb
movl %ebx, %r12d
movl $0x1505, %r13d          # imm = 0x1505
testl %ebx, %ebx
je 0x2cd1
xorl %eax, %eax
movl %r13d, %ecx
shll $0x5, %ecx
addl %r13d, %ecx
movzbl (%r14,%rax), %r13d
addl %ecx, %r13d
incq %rax
cmpl %eax, %r12d
jne 0x2cb8
leaq 0x8(%r15), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
xorl %eax, %eax
movq %r15, -0x38(%rbp)
movq %rax, -0x48(%rbp)
shlq $0x5, %rax
movq -0x40(%rbp), %rdx
movl 0x10(%rdx,%rax), %ecx
andl %r13d, %ecx
movq (%rdx,%rax), %rax
movq (%rax,%rcx,8), %r15
testq %r15, %r15
je 0x2d25
cmpl %ebx, (%r15)
jne 0x2d1f
movq 0x8(%r15), %rsi
movq %r14, %rdi
movq %r12, %rdx
callq 0x22c0
testl %eax, %eax
je 0x2d3f
movq 0x18(%r15), %r15
jmp 0x2d02
movq -0x38(%rbp), %r15
cmpl $-0x1, 0x48(%r15)
je 0x2d4d
movq -0x48(%rbp), %rcx
leaq 0x1(%rcx), %rax
testq %rcx, %rcx
je 0x2ce7
jmp 0x2d4d
movq %r15, -0x30(%rbp)
jmp 0x2d4d
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
cmpq $0x0, 0x8(%rsi)
je 0x2f2d
xorl %r15d, %r15d
cmpq $0x0, 0x18(%rbx)
je 0x2f2d
movq (%rbx), %rax
movq (%rax,%r15,8), %r14
testq %r14, %r14
je 0x2f24
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 %r12, %r12
jne 0x2efa
incq %r15
cmpq 0x8(%rbx), %r15
jb 0x2ee7
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_O1/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
movl $0x28, %edi
callq 0x22a0
movq %rbx, (%rax)
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
movq %rcx, 0x8(%rax)
movl $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
cmpq $0x0, 0x18(%rdi)
je 0x300e
leaq 0x20(%rdi), %rcx
jmp 0x3068
movq (%rdi), %rcx
movslq 0x8(%rdi), %rdx
movq %rdx, %rax
shlq $0x5, %rax
addq %rcx, %rax
addq $0x8, %rax
cmpl $0x0, 0x10(%rdi)
je 0x3035
movl 0xc(%rdi), %esi
notl %esi
orl %edx, %esi
jne 0x3035
incl 0x4c(%rcx)
movl 0xc(%rdi), %esi
incl %esi
movl %esi, 0xc(%rdi)
cmpl 0x8(%rax), %esi
jl 0x305d
xorl %eax, %eax
cmpl $-0x1, 0x48(%rcx)
je 0x307c
testl %edx, %edx
jne 0x307c
movq $0x1, 0x8(%rdi)
addq $0x28, %rcx
movq %rcx, %rax
movslq 0xc(%rdi), %rcx
shlq $0x3, %rcx
addq (%rax), %rcx
movq (%rcx), %rax
movq %rax, 0x18(%rdi)
testq %rax, %rax
je 0x300e
movq 0x18(%rax), %rcx
movq %rcx, 0x20(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x30c1
xorl %r14d, %r14d
jmp 0x3166
movq %rdi, %rbx
cmpl $-0x1, 0x48(%rdi)
je 0x30dd
cmpl $0x0, 0x4c(%rbx)
jne 0x30dd
movq %rbx, %rdi
movl $0x1, %esi
callq 0x27fb
cmpl $-0x1, 0x48(%rbx)
je 0x3121
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 0x310f
shlq $0x3, %rcx
addq 0x8(%rbx), %rcx
movq %rcx, %rax
jmp 0x3117
shlq $0x3, %rax
addq 0x28(%rbx), %rax
movq (%rax), %r14
testq %r14, %r14
je 0x30e3
jmp 0x3136
callq 0x2280
movq 0x8(%rbx), %rcx
andl 0x18(%rbx), %eax
movq (%rcx,%rax,8), %r14
testq %r14, %r14
je 0x3121
xorl %ebx, %ebx
movq %r14, %rax
movq 0x18(%rax), %rax
incq %rbx
testq %rax, %rax
jne 0x313b
callq 0x2280
cqto
idivq %rbx
testq %rdx, %rdx
je 0x3166
decl %edx
movq 0x18(%r14), %r14
addl $-0x1, %edx
jae 0x3166
testq %r14, %r14
jne 0x3158
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x31d3
cmpl $-0x1, 0x48(%rbx)
je 0x31cc
leaq 0x4f0d(%rip), %rdi      # 0x80c5
callq 0x20b0
addq $0x28, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x31d3
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movq %rdi, %rbx
movq 0x10(%rdi), %r12
testq %r12, %r12
je 0x34c0
movl %esi, %r14d
movq (%rbx), %r15
movq 0x8(%r15), %r13
testl %r14d, %r14d
jne 0x34ad
movq 0x10(%r15), %rdi
callq 0x2030
decq %r12
movq %r15, %rdi
callq 0x2030
movq %r13, %r15
testq %r12, %r12
jne 0x349b
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_O1/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
movl $0x18, %edi
callq 0x22a0
testq %rax, %rax
je 0x3515
movq %r14, 0x10(%rax)
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0x3519
movq $0x0, (%rax)
movq (%rbx), %rdx
movq %rdx, 0x8(%rax)
movq %rax, (%rdx)
movq %rax, (%rbx)
jmp 0x3526
xorl %ebx, %ebx
jmp 0x352d
movq %rax, 0x8(%rbx)
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
incq %rcx
movq %rcx, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x18, %edi
callq 0x22a0
testq %rax, %rax
je 0x3577
movq %r14, 0x10(%rax)
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0x357b
movq 0x8(%rbx), %rdx
movq %rdx, (%rax)
movq $0x0, 0x8(%rax)
movq %rax, 0x8(%rdx)
movq %rax, 0x8(%rbx)
jmp 0x3588
xorl %ebx, %ebx
jmp 0x358f
movq %rax, 0x8(%rbx)
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
incq %rcx
movq %rcx, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x18, %edi
callq 0x22a0
testq %rax, %rax
je 0x35dd
movq %r12, 0x10(%rax)
testl %r15d, %r15d
je 0x35e1
movq %r14, (%rax)
movq 0x8(%r14), %rcx
movq %rcx, 0x8(%rax)
cmpq %r14, 0x8(%rbx)
jne 0x35f6
leaq 0x8(%rbx), %rcx
jmp 0x35f3
xorl %ebx, %ebx
jmp 0x3612
movq %r14, 0x8(%rax)
movq (%r14), %rcx
movq %rcx, (%rax)
movq %rbx, %rcx
cmpq %r14, (%rbx)
jne 0x35f6
movq %rax, (%rcx)
movq (%rax), %rcx
testq %rcx, %rcx
je 0x3602
movq %rax, 0x8(%rcx)
movq 0x8(%rax), %rcx
testq %rcx, %rcx
je 0x360e
movq %rax, (%rcx)
incq 0x10(%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movq 0x8(%rsi), %rcx
leaq 0x8(%rax), %rsi
testq %rax, %rax
cmoveq %rdi, %rsi
movq %rcx, (%rsi)
movq 0x8(%r14), %rcx
leaq 0x8(%rdi), %rsi
testq %rcx, %rcx
cmovneq %rcx, %rsi
movq %rax, (%rsi)
testl %edx, %edx
jne 0x365f
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_O1/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 0x36f3
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_O1/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
subq $0x18, %rsp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %r12
movl $0x10, %edi
callq 0x22a0
testq %rax, %rax
je 0x3730
movq %rax, %rdi
movq (%r12), %rax
movq %rax, (%rdi)
movl $0x0, 0x8(%rdi)
jmp 0x3732
xorl %edi, %edi
movq (%rdi), %r12
testq %r12, %r12
je 0x378a
xorl %ebx, %ebx
movq %rdi, -0x30(%rbp)
cmpl $0x0, 0x8(%rdi)
sete %bl
movl %r14d, %eax
movq %rax, -0x38(%rbp)
shll $0x3, %ebx
movq (%r12,%rbx), %r13
movq 0x10(%r12), %rdi
testl %r14d, %r14d
jle 0x3771
movq %r15, %rsi
movq -0x38(%rbp), %rdx
callq 0x22c0
testl %eax, %eax
jne 0x3776
jmp 0x3781
cmpq %r15, %rdi
je 0x3781
movq %r13, %r12
testq %r13, %r13
jne 0x3751
xorl %r12d, %r12d
movq -0x30(%rbp), %rdi
movq %r13, (%rdi)
jmp 0x378d
xorl %r12d, %r12d
callq 0x2030
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_O1/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 0x37d7
movq (%rax), %rax
setne %cl
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x37ee
decq %rsi
movq 0x8(%rax), %rax
addq $-0x1, %rsi
jae 0x37ee
testq %rax, %rax
jne 0x37c6
jmp 0x37ee
addq $0x8, %rax
incq %rsi
movq (%rax), %rax
testq %rsi, %rsi
je 0x37ee
incq %rsi
testq %rax, %rax
jne 0x37de
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x381d
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rax
movq (%rax), %rcx
movq %rcx, 0x8(%rdi)
xorl %edx, %edx
movq %rdx, 0x8(%rcx)
movq (%rdi), %rcx
movq %rax, (%rcx)
movq %rdx, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, (%rdi)
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x2fc4
movq %rax, %r14
movq %rax, %rdi
callq 0x2ffd
testq %rax, %rax
je 0x387a
movq %rax, %r15
movq 0x10(%r15), %r12
movq 0x8(%r15), %rsi
movl (%r15), %edx
movq %rbx, %rdi
callq 0x2ec0
movq 0x8(%r15), %rdi
callq 0x2030
movq %r12, %rdi
callq 0x2f4a
movq %r14, %rdi
callq 0x2ffd
movq %rax, %r15
testq %rax, %rax
jne 0x3846
movq %r14, %rdi
callq 0x307e
movq %rbx, %rdi
callq 0x2f4a
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x3c79
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 0x26f7
movq %rax, %r14
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
movq %rax, %rcx
movl $0x8, %r8d
callq 0x2a3a
testl %eax, %eax
je 0x3c7c
movq %r14, %rdi
callq 0x2f4a
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
testq %rdx, %rdx
sete %dl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
orb %cl, %dl
jne 0x3d21
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 0x2a3a
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
// File: /workspace/github_c_makefile_star2_O1/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
subq $0x28, %rsp
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
orb %al, %cl
jne 0x3ee8
movq %rdi, %r14
movq %rsi, %rdi
movl $0x42, %esi
movl $0x1b4, %edx            # imm = 0x1B4
xorl %eax, %eax
callq 0x22f0
cmpl $-0x1, %eax
je 0x3ee8
movl %eax, -0x30(%rbp)
movq %r14, %rdi
callq 0x2f8b
movq %rax, -0x48(%rbp)
leaq 0x4408(%rip), %r13      # 0x8199
leaq 0x43a8(%rip), %r15      # 0x8140
movq -0x48(%rbp), %rdi
callq 0x2ffd
testq %rax, %rax
je 0x3ecc
movl -0x30(%rbp), %ebx
testl %ebx, %ebx
setns -0x40(%rbp)
movq 0x8(%rax), %r12
movq 0x10(%rax), %r14
movl $0x1, %edx
movl %ebx, %edi
leaq 0x436f(%rip), %rsi      # 0x8138
callq 0x20f0
movq %r12, %rdi
callq 0x2130
movl %ebx, %edi
movq %r12, %rsi
movq %rax, %rdx
callq 0x20f0
movl $0x1, %edx
movl %ebx, %edi
leaq 0x43e2(%rip), %rsi      # 0x81d3
callq 0x20f0
movl $0x1, %edx
movl %ebx, %edi
movq %r13, %r12
movq %r13, %rsi
callq 0x20f0
testq %r14, %r14
setne %al
andb -0x40(%rbp), %al
movl $0xffffffff, -0x34(%rbp) # imm = 0xFFFFFFFF
cmpb $0x1, %al
jne 0x3edc
movb %al, -0x29(%rbp)
movq %r14, %rdi
callq 0x2f8b
movq %rax, %r14
movq %rax, %rdi
callq 0x2ffd
testq %rax, %rax
movq %r12, %r13
movq %r15, %r12
movl -0x30(%rbp), %ebx
je 0x3eb5
movq %r14, -0x40(%rbp)
movq %r13, %r14
movq %r12, %r13
movq 0x8(%rax), %r12
movq 0x10(%rax), %r15
movq %r12, %rdi
callq 0x2130
movl %ebx, %edi
movq %r12, %rsi
movq %r13, %r12
movq %r14, %r13
movq -0x40(%rbp), %r14
movq %rax, %rdx
callq 0x20f0
movl $0x1, %edx
movl %ebx, %edi
movq %r12, %rsi
callq 0x20f0
movq %r15, %rdi
callq 0x2130
movl %ebx, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x20f0
movl $0x1, %edx
movl %ebx, %edi
movq %r13, %rsi
callq 0x20f0
movq %r14, %rdi
callq 0x2ffd
testq %rax, %rax
jne 0x3e48
movq %r14, %rdi
callq 0x307e
cmpb $0x0, -0x29(%rbp)
movq %r12, %r15
jne 0x3d98
jmp 0x3edc
movq -0x48(%rbp), %rdi
callq 0x307e
movl $0x0, -0x34(%rbp)
movl -0x30(%rbp), %edi
callq 0x21c0
movl -0x34(%rbp), %r15d
movl %r15d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
orb %al, %cl
jne 0x4142
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x2130
movq %rax, %r12
movq %r14, %rdi
movq %rbx, %rsi
movl %r12d, %edx
callq 0x2f73
testq %rax, %rax
je 0x4142
movq %rax, %rdi
callq 0x2f4a
movq %r14, %rdi
movq %rbx, %rsi
movl %r12d, %edx
callq 0x2d60
xorl %r15d, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x4298
movq %rdi, %rbx
leaq 0x3f25(%rip), %rsi      # 0x8142
callq 0x2040
testl %eax, %eax
je 0x4298
leaq 0x3f19(%rip), %rsi      # 0x8146
movq %rbx, %rdi
callq 0x2040
testl %eax, %eax
je 0x42a1
leaq 0x3f0c(%rip), %rsi      # 0x814c
movq %rbx, %rdi
callq 0x2040
testl %eax, %eax
je 0x42a8
leaq 0x3efe(%rip), %rsi      # 0x8151
movq %rbx, %rdi
callq 0x2040
testl %eax, %eax
je 0x42af
leaq 0x3ef0(%rip), %rsi      # 0x8156
movq %rbx, %rdi
callq 0x2040
testl %eax, %eax
je 0x42b6
leaq 0x3ee3(%rip), %rsi      # 0x815c
movq %rbx, %rdi
callq 0x2040
testl %eax, %eax
je 0x42bd
leaq 0x3ed6(%rip), %rsi      # 0x8162
movq %rbx, %rdi
callq 0x2040
testl %eax, %eax
je 0x42c4
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl $0x64, %eax
jmp 0x429a
movl $0xc8, %eax
jmp 0x429a
movl $0x12c, %eax            # imm = 0x12C
jmp 0x429a
movl $0x190, %eax            # imm = 0x190
jmp 0x429a
movl $0x1f4, %eax            # imm = 0x1F4
jmp 0x429a
movl $0x258, %eax            # imm = 0x258
jmp 0x429a
// File: /workspace/github_c_makefile_star2_O1/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 0x7f0e(%rip), %rdi      # 0xc200
callq 0x23b0
movl $0x38, %edi
callq 0x22a0
testq %rax, %rax
je 0x435e
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movq $0x0, 0x30(%rax)
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 0x7eeb(%rip), %rdx      # 0xc228
testq %rdx, %rdx
je 0x4354
movq %rdx, %rcx
movq 0x30(%rdx), %rdx
testq %rdx, %rdx
jne 0x4342
addq $0x30, %rcx
jmp 0x435b
leaq 0x7ecd(%rip), %rcx      # 0xc228
movq %rax, (%rcx)
leaq 0x7e9b(%rip), %rdi      # 0xc200
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_O1/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 %r14
pushq %rbx
movq 0x7e9f(%rip), %r14      # 0xc228
xorl %ebx, %ebx
testq %r14, %r14
je 0x43b4
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x43a4
movq 0x28(%r14), %rdi
callq *%rax
cmpl $-0x1, %eax
je 0x43aa
movq 0x30(%r14), %r14
jmp 0x438b
callq 0x23e0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
pushq %rax
leaq 0x7e11(%rip), %rdi      # 0xc200
callq 0x23b0
movq 0x7e2d(%rip), %rbx      # 0xc228
testq %rbx, %rbx
je 0x4421
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x4414
movq 0x28(%rbx), %rdi
callq *%rax
cmpl $-0x1, %eax
je 0x441a
movq 0x30(%rbx), %rbx
jmp 0x43fb
callq 0x240f
jmp 0x4414
leaq 0x7dd8(%rip), %rdi      # 0xc200
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2290
// File: /workspace/github_c_makefile_star2_O1/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 0x448e
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 0x7d6b(%rip), %r14      # 0xc200
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 $0x64, %edi
movq %rbx, %rsi
callq 0x44dd
movq %r14, %rdi
callq 0x2290
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x473f
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 0x7aba(%rip), %r14      # 0xc200
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 0x44dd
movq %r14, %rdi
callq 0x2290
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x47e9
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 0x7a10(%rip), %r14      # 0xc200
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 0x44dd
movq %r14, %rdi
callq 0x2290
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/buf1024[P]mysch/log.c
// Function: log_error
void log_error(const char* format, ...)
{
    va_list ap;

    pthread_mutex_lock(&_ctx_mutex);
    va_start(ap, format);
    log_message(LOG_ERROR, 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 0x4893
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 0x7966(%rip), %r14      # 0xc200
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 $0x190, %edi            # imm = 0x190
movq %rbx, %rsi
callq 0x44dd
movq %r14, %rdi
callq 0x2290
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x493d
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 0x78bc(%rip), %r14      # 0xc200
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 0x44dd
movq %r14, %rdi
callq 0x2290
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
callq 0x43e2
leaq 0x7861(%rip), %rdi      # 0xc200
callq 0x23b0
movq 0x787d(%rip), %rbx      # 0xc228
testq %rbx, %rbx
je 0x49e1
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x49c4
movq 0x28(%rbx), %rdi
callq *%rax
cmpl $-0x1, %eax
je 0x49da
movq 0x30(%rbx), %r14
movq %rbx, %rdi
callq 0x2030
movq %r14, %rbx
testq %r14, %r14
jne 0x49b0
jmp 0x49e1
callq 0x2460
jmp 0x49c4
leaq 0x7818(%rip), %rdi      # 0xc200
callq 0x2290
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %esi, %r13d
movl 0x10(%rbp), %ebx
xorl %eax, %eax
movq %rax, 0x780a(%rip)      # 0xc228
xorps %xmm0, %xmm0
movups %xmm0, 0x77d8(%rip)     # 0xc200
movups %xmm0, 0x77e1(%rip)     # 0xc210
movq %rax, 0x77ea(%rip)      # 0xc220
leaq 0x181(%rip), %rdx       # 0x4bbe
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x42cb
movl %r13d, %edi
movq %r12, %rsi
movq %r15, %rdx
movl %r14d, %ecx
movl -0x2c(%rbp), %r8d
movl %ebx, %r9d
callq 0x4aae
cmpl $-0x1, %eax
je 0x4a7c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x437b
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq