// File: /workspace/github_c_makefile_star2_O0/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
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x2f2d
movl $0x1, -0x4(%rbp)
jmp 0x30b0
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x48(%rax)
je 0x2f40
movq -0x10(%rbp), %rdi
callq 0x2bd0
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x2530
movl %eax, -0x24(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x40(%rbp)
movl $0x0, -0x3c(%rbp)
cmpl $0x1, -0x3c(%rbp)
jg 0x30a9
movl -0x24(%rbp), %eax
movq -0x10(%rbp), %rcx
addq $0x8, %rcx
movslq -0x3c(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
andq 0x10(%rcx), %rax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movslq -0x3c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl -0x28(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x308d
movl -0x40(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x3074
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
movl -0x40(%rbp), %eax
movl %eax, %edx
callq 0x21e0
cmpl $0x0, %eax
jne 0x3074
cmpq $0x0, -0x38(%rbp)
je 0x2ffe
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x3023
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x10(%rbp), %rax
addq $0x8, %rax
movslq -0x3c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl -0x28(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
cmpl $0x0, -0x20(%rbp)
jne 0x3043
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2030
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2030
movq -0x30(%rbp), %rdi
callq 0x2030
movq -0x10(%rbp), %rax
addq $0x8, %rax
movslq -0x3c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x18(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x30b0
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x2fac
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x48(%rax)
jne 0x3099
jmp 0x30a9
jmp 0x309b
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x2f5c
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)