// File: /workspace/github_c_makefile_star2_O3/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 0x2e72
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 0x2d61
cmpl $0x0, 0x4c(%r14)
jne 0x2d61
movq %r14, %rdi
movl $0x1, %esi
callq 0x27fb
movl %r13d, %edx
movl $0x1505, %esi           # imm = 0x1505
testl %r13d, %r13d
je 0x2d84
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 0x2d70
leaq 0x8(%r14), %rax
movq %rax, -0x48(%rbp)
movb $0x1, %al
xorl %ecx, %ecx
movq %r14, -0x50(%rbp)
movl %esi, -0x30(%rbp)
movl %eax, -0x34(%rbp)
shlq $0x5, %rcx
movq -0x48(%rbp), %rax
movl 0x10(%rax,%rcx), %edi
andl %esi, %edi
movq %rcx, -0x40(%rbp)
movq (%rax,%rcx), %rax
movq %rdi, -0x60(%rbp)
movq %rax, -0x58(%rbp)
movq (%rax,%rdi,8), %rax
testq %rax, %rax
je 0x2df6
movq -0x48(%rbp), %rcx
addq %rcx, -0x40(%rbp)
xorl %r12d, %r12d
movq %rax, %r14
cmpl %r13d, (%rax)
jne 0x2dea
movq 0x8(%r14), %rsi
movq %rbx, %rdi
movq %rdx, %r15
callq 0x22c0
movq %r15, %rdx
testl %eax, %eax
je 0x2e1b
movq 0x18(%r14), %rax
movq %r14, %r12
testq %rax, %rax
jne 0x2dcc
movq -0x50(%rbp), %r14
cmpl $-0x1, 0x48(%r14)
setne %al
movl $0x1, %ecx
testb %al, -0x34(%rbp)
movl $0x0, %eax
movl -0x30(%rbp), %esi
jne 0x2d97
movl $0x1, %eax
jmp 0x2e64
movq -0x60(%rbp), %rax
movq -0x58(%rbp), %rcx
leaq (%rcx,%rax,8), %rax
leaq 0x18(%r12), %rcx
testq %r12, %r12
movq 0x18(%r14), %rdx
cmoveq %rax, %rcx
movq %rdx, (%rcx)
cmpl $0x0, -0x2c(%rbp)
jne 0x2e52
movq 0x8(%r14), %rdi
callq 0x2030
movq 0x10(%r14), %rdi
callq 0x2030
movq %r14, %rdi
callq 0x2030
movq -0x40(%rbp), %rax
decq 0x18(%rax)
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq