// File: /workspace/github_c_makefile_star2_O1/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:
movl $0x1, %eax
cmpq $0x0, 0x10(%rdi)
je 0x2ebf
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %r13d
movq %rsi, %rbx
movq %rdi, %r14
movl %ecx, -0x2c(%rbp)
cmpl $-0x1, 0x48(%rdi)
je 0x2db0
cmpl $0x0, 0x4c(%r14)
jne 0x2db0
movq %r14, %rdi
movl $0x1, %esi
callq 0x27fb
movl %r13d, %edx
movl $0x1505, %esi           # imm = 0x1505
testl %r13d, %r13d
je 0x2dd3
xorl %eax, %eax
movl %esi, %ecx
shll $0x5, %ecx
addl %esi, %ecx
movzbl (%rbx,%rax), %esi
addl %ecx, %esi
incq %rax
cmpl %eax, %edx
jne 0x2dbf
leaq 0x8(%r14), %rax
movq %rax, -0x40(%rbp)
xorl %eax, %eax
movq %r14, -0x48(%rbp)
movl %esi, -0x30(%rbp)
movq %rax, -0x60(%rbp)
shlq $0x5, %rax
movq -0x40(%rbp), %rcx
movl 0x10(%rcx,%rax), %edi
andl %esi, %edi
movq %rax, -0x38(%rbp)
movq (%rcx,%rax), %rax
movq %rdi, -0x58(%rbp)
movq %rax, -0x50(%rbp)
movq (%rax,%rdi,8), %rax
testq %rax, %rax
je 0x2e44
movq -0x40(%rbp), %rcx
addq %rcx, -0x38(%rbp)
xorl %r12d, %r12d
movq %rax, %r14
cmpl %r13d, (%rax)
jne 0x2e38
movq 0x8(%r14), %rsi
movq %rbx, %rdi
movq %rdx, %r15
callq 0x22c0
movq %r15, %rdx
testl %eax, %eax
je 0x2e66
movq 0x18(%r14), %rax
movq %r14, %r12
testq %rax, %rax
jne 0x2e1a
movq -0x48(%rbp), %r14
cmpl $-0x1, 0x48(%r14)
je 0x2e5f
movq -0x60(%rbp), %rcx
leaq 0x1(%rcx), %rax
testq %rcx, %rcx
movl -0x30(%rbp), %esi
je 0x2de4
movl $0x1, %eax
jmp 0x2eb1
testq %r12, %r12
je 0x2e76
movq 0x18(%r14), %rax
movq %rax, 0x18(%r12)
jmp 0x2e86
movq 0x18(%r14), %rax
movq -0x58(%rbp), %rcx
movq -0x50(%rbp), %rdx
movq %rax, (%rdx,%rcx,8)
movl -0x2c(%rbp), %eax
testl %eax, %eax
jne 0x2e9f
movq 0x8(%r14), %rdi
callq 0x2030
movq 0x10(%r14), %rdi
callq 0x2030
movq %r14, %rdi
callq 0x2030
movq -0x38(%rbp), %rax
decq 0x18(%rax)
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq