// File: /workspace/github_c_makefile_star2_O0/andyfighting[P]hiredis_timer_cmpt/./dict.c
// Function: dictExpand
static int dictExpand(dict *ht, unsigned long size) {
    dict n; /* the new hashtable */
    unsigned long realsize = _dictNextPower(size), i;

    /* the size is invalid if it is smaller than the number of
     * elements already inside the hashtable */
    if (ht->used > size)
        return DICT_ERR;

    _dictInit(&n, ht->type, ht->privdata);
    n.size = realsize;
    n.sizemask = realsize-1;
    n.table = calloc(realsize,sizeof(dictEntry*));

    /* Copy all the elements from the old to the new table:
     * note that if the old hash table is empty ht->size is zero,
     * so dictExpand just creates an hash table. */
    n.used = ht->used;
    for (i = 0; i < ht->size && ht->used > 0; i++) {
        dictEntry *he, *nextHe;

        if (ht->table[i] == NULL) continue;

        /* For each hash entry on this slot... */
        he = ht->table[i];
        while(he) {
            unsigned int h;

            nextHe = he->next;
            /* Get the new element index */
            h = dictHashKey(ht, he->key) & n.sizemask;
            he->next = n.table[h];
            n.table[h] = he;
            ht->used--;
            /* Pass to the next element */
            he = nextHe;
        }
    }
    assert(ht->used == 0);
    free(ht->table);

    /* Remap the new hashtable in the old */
    *ht = n;
    return DICT_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0xb290
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
cmpq -0x18(%rbp), %rax
jbe 0xb107
movl $0x1, -0x4(%rbp)
jmp 0xb282
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdx
leaq -0x48(%rbp), %rdi
callq 0xa5c0
movq -0x50(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x50(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x50(%rbp), %rdi
movl $0x8, %esi
callq 0x3290
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rcx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
cmpq 0x10(%rdx), %rcx
movb %al, -0x6d(%rbp)
jae 0xb17c
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
seta %al
movb %al, -0x6d(%rbp)
movb -0x6d(%rbp), %al
testb $0x1, %al
jne 0xb188
jmp 0xb231
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x58(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0xb19f
jmp 0xb220
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x58(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0xb21e
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq -0x60(%rbp), %rcx
movq (%rcx), %rdi
callq *%rax
movl %eax, %eax
andq -0x30(%rbp), %rax
movl %eax, -0x6c(%rbp)
movq -0x48(%rbp), %rax
movl -0x6c(%rbp), %ecx
movq (%rax,%rcx,8), %rcx
movq -0x60(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x60(%rbp), %rdx
movq -0x48(%rbp), %rax
movl -0x6c(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x20(%rax)
movq -0x68(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0xb1b2
jmp 0xb220
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0xb15a
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0xb23e
jmp 0xb25d
leaq 0x2613(%rip), %rdi      # 0xd858
leaq 0x261a(%rip), %rsi      # 0xd866
movl $0x7e, %edx
leaq 0x2617(%rip), %rcx      # 0xd86f
callq 0x31c0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3040
movq -0x10(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movl $0x30, %edx
callq 0x32f0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)