// File: /workspace/github_cpp_makefile_star2_O3/qian-jiahong[P]uvncrep017-ws/iniparser.cpp
// Function: dictionary_set(_dictionary_*, char*, char*)
static void dictionary_set(dictionary * d, char * key, char * val)
{
    int         i ;
    unsigned    hash ;

    if (d==NULL || key==NULL) return ;

    /* Compute hash for this key */
    hash = dictionary_hash(key) ;
    /* Find if value is already in blackboard */
    if (d->n>0) {
        for (i=0 ; i<d->size ; i++) {
            if (d->key[i]==NULL)
                continue ;
            if (hash==d->hash[i]) { /* Same hash value */
                if (!strcmp(key, d->key[i])) {   /* Same key */
                    /* Found a value: modify and return */
                    if (d->val[i]!=NULL)
                        free(d->val[i]);
                    d->val[i] = val ? strdup(val) : NULL ;
                    /* Value has been modified: return */
                    return ;
                }
            }
        }
    }
    /* Add a new value */
    /* See if dictionary needs to grow */
    if (d->n==d->size) {

        /* Reached maximum size: reallocate blackboard */
        d->val  = (char **)mem_double(d->val,  d->size * sizeof(char*)) ;
        d->key  = (char **)mem_double(d->key,  d->size * sizeof(char*)) ;
        d->hash = (unsigned int *)mem_double(d->hash, d->size * sizeof(unsigned)) ;

        /* Double size */
        d->size *= 2 ;
    }

    /* Insert key in the first empty slot */
    for (i=0 ; i<d->size ; i++) {
        if (d->key[i]==NULL) {
            /* Add key here */
            break ;
        }
    }
    /* Copy key */
    d->key[i]  = strdup(key);
    d->val[i]  = val ? strdup(val) : NULL ;
    d->hash[i] = hash;
    d->n ++ ;
    return ;
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x5ef0
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %rsi, %rdi
callq 0x6347
movl %eax, 0x4(%rsp)
movl (%rbx), %r14d
movl 0x4(%rbx), %r12d
testl %r14d, %r14d
setg %al
testl %r12d, %r12d
setg %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x5dbb
movl %r12d, %ebp
movq 0x10(%rbx), %r15
xorl %r13d, %r13d
movq (%r15,%r13,8), %rsi
testq %rsi, %rsi
je 0x5db3
movq 0x18(%rbx), %rax
movl 0x4(%rsp), %ecx
cmpl (%rax,%r13,4), %ecx
jne 0x5db3
movq 0x8(%rsp), %rdi
callq 0x22a0
testl %eax, %eax
je 0x5ef1
incq %r13
cmpq %r13, %rbp
jne 0x5d8a
cmpl %r12d, %r14d
jne 0x5e7f
movq 0x8(%rbx), %r12
leal (,%r14,8), %ebp
shll $0x4, %r14d
movslq %r14d, %rdi
movl $0x1, %esi
callq 0x2150
movq %rax, %r13
movslq %ebp, %rdx
movq %rax, %rdi
movq %r12, %rsi
callq 0x21a0
movq %r12, %rdi
callq 0x2240
movq %r13, 0x8(%rbx)
movq 0x10(%rbx), %r12
movl 0x4(%rbx), %eax
leal (,%rax,8), %ebp
shll $0x4, %eax
movslq %eax, %rdi
movl $0x1, %esi
callq 0x2150
movq %rax, %r13
movslq %ebp, %rdx
movq %rax, %rdi
movq %r12, %rsi
callq 0x21a0
movq %r12, %rdi
callq 0x2240
movq %r13, 0x10(%rbx)
movq 0x18(%rbx), %r12
movl 0x4(%rbx), %eax
leal (,%rax,4), %ebp
shll $0x3, %eax
movslq %eax, %rdi
movl $0x1, %esi
callq 0x2150
movq %rax, %r13
movslq %ebp, %rdx
movq %rax, %rdi
movq %r12, %rsi
callq 0x21a0
movq %r12, %rdi
callq 0x2240
movq %r13, 0x18(%rbx)
movl 0x4(%rbx), %r12d
addl %r12d, %r12d
movl %r12d, 0x4(%rbx)
movq 0x10(%rbx), %r14
testl %r12d, %r12d
jle 0x5ea8
movl %r12d, %ecx
xorl %eax, %eax
movq 0x8(%rsp), %rdi
cmpq $0x0, (%r14,%rax,8)
je 0x5ea3
incq %rax
cmpq %rax, %rcx
jne 0x5e92
movl %ecx, %eax
movl %eax, %r12d
jmp 0x5eb0
xorl %r12d, %r12d
movq 0x8(%rsp), %rdi
callq 0x2340
movq %rax, (%r14,%r12,8)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x5eca
callq 0x2340
jmp 0x5ecc
xorl %eax, %eax
movq 0x8(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
movq 0x18(%rbx), %rax
movl 0x4(%rsp), %ecx
movl %ecx, (%rax,%r12,4)
incl (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rbx), %rax
movq (%rax,%r13,8), %rdi
testq %rdi, %rdi
je 0x5f03
callq 0x2240
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x5f14
callq 0x2340
jmp 0x5f16
xorl %eax, %eax
movq 0x8(%rbx), %rcx
movq %rax, (%rcx,%r13,8)
jmp 0x5ee2