// File: /workspace/github_cpp_makefile_star2_O1/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 0x5f29
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq %rdx, 0x10(%rsp)
movq %rsi, %rdi
callq 0x63c4
movl (%rbx), %r13d
testl %r13d, %r13d
movl %eax, 0xc(%rsp)
jle 0x5df7
movslq 0x4(%rbx), %r14
testq %r14, %r14
jle 0x5df7
movl %eax, %ecx
movq 0x10(%rbx), %rbp
xorl %r12d, %r12d
movq (%rbp,%r12,8), %rsi
testq %rsi, %rsi
je 0x5def
movq 0x18(%rbx), %rax
cmpl (%rax,%r12,4), %ecx
jne 0x5def
movq %r15, %rdi
callq 0x22a0
movl 0xc(%rsp), %ecx
testl %eax, %eax
je 0x5f2a
incq %r12
cmpq %r12, %r14
jne 0x5dc7
movl 0x4(%rbx), %eax
cmpl %eax, %r13d
jne 0x5eb4
movq 0x8(%rbx), %r12
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, 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)
shll 0x4(%rbx)
movl 0x4(%rbx), %eax
testl %eax, %eax
jle 0x5edc
movq 0x10(%rbx), %rdx
xorl %ecx, %ecx
movq 0x10(%rsp), %r12
cmpq $0x0, (%rdx,%rcx,8)
je 0x5ed7
incq %rcx
cmpq %rcx, %rax
jne 0x5ec6
movl %eax, %ecx
movl %ecx, %r14d
jmp 0x5ee4
xorl %r14d, %r14d
movq 0x10(%rsp), %r12
movq %r15, %rdi
callq 0x2340
movq 0x10(%rbx), %rcx
movq %rax, (%rcx,%r14,8)
testq %r12, %r12
je 0x5f03
movq %r12, %rdi
callq 0x2340
jmp 0x5f05
xorl %eax, %eax
movq 0x8(%rbx), %rcx
movq %rax, (%rcx,%r14,8)
movq 0x18(%rbx), %rax
movl 0xc(%rsp), %ecx
movl %ecx, (%rax,%r14,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,%r12,8), %rdi
testq %rdi, %rdi
je 0x5f3c
callq 0x2240
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x5f4d
callq 0x2340
jmp 0x5f4f
xorl %eax, %eax
movq 0x8(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
jmp 0x5f1b