// File: /workspace/github_c_makefile_star2_O2/msteveb[P]autosetup/./jimsh0.c
// Function: DictAddElement
static int DictAddElement(Jim_Interp *interp, Jim_Obj *objPtr,
    Jim_Obj *keyObjPtr, Jim_Obj *valueObjPtr)
{
    Jim_Dict *dict = objPtr->internalRep.dictValue;
    if (valueObjPtr == NULL) {

        int tvoffset = JimDictHashFind(dict, keyObjPtr, DICT_HASH_REMOVE);
        if (tvoffset) {

            Jim_DecrRefCount(interp, dict->table[tvoffset - 1]);
            Jim_DecrRefCount(interp, dict->table[tvoffset]);
            dict->len -= 2;
            if (tvoffset != dict->len + 1) {

                dict->table[tvoffset - 1] = dict->table[dict->len];
                dict->table[tvoffset] = dict->table[dict->len + 1];


                JimDictHashFind(dict, dict->table[tvoffset - 1], tvoffset);
            }
            return JIM_OK;
        }
        return JIM_ERR;
    }
    else {

        int tvoffset = JimDictAdd(dict, keyObjPtr);
        if (tvoffset) {

            Jim_IncrRefCount(valueObjPtr);
            Jim_DecrRefCount(interp, dict->table[tvoffset]);
            dict->table[tvoffset] = valueObjPtr;
        }
        else {
            if (dict->maxLen == dict->len) {

                if (dict->maxLen < 4) {
                    dict->maxLen = 4;
                }
                else {
                    dict->maxLen *= 2;
                }
                dict->table = Jim_Realloc(dict->table, dict->maxLen * sizeof(*dict->table));
            }
            Jim_IncrRefCount(keyObjPtr);
            Jim_IncrRefCount(valueObjPtr);

            dict->table[dict->len++] = keyObjPtr;
            dict->table[dict->len++] = valueObjPtr;

        }
        return JIM_OK;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r12
movq %rdi, %r15
movq 0x18(%rsi), %rbx
testq %rcx, %rcx
je 0xe2ea
movq %rcx, %r14
movq %rbx, %rdi
movq %r12, %rsi
callq 0x170c7
testl %eax, %eax
je 0xe38f
incl 0x10(%r14)
movq 0x18(%rbx), %rcx
movslq %eax, %r12
movq (%rcx,%r12,8), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %edx
movl %edx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0xe2e1
movq %r15, %rdi
callq 0x73bf
movq 0x18(%rbx), %rcx
movq %r14, (%rcx,%r12,8)
jmp 0xe3e8
pushq $-0x2
popq %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0xe553
testl %eax, %eax
je 0xe3bf
movl %eax, %r12d
movq 0x18(%rbx), %rax
movslq %r12d, %r14
movq -0x8(%rax,%r14,8), %rsi
movl 0x10(%rsi), %ecx
leal -0x1(%rcx), %edx
movl %edx, 0x10(%rsi)
cmpl $0x1, %ecx
jg 0xe329
movq %r15, %rdi
callq 0x73bf
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0xe343
movq %r15, %rdi
callq 0x73bf
movslq 0x20(%rbx), %rax
leal -0x2(%rax), %ecx
movl %ecx, 0x20(%rbx)
leal -0x1(%rax), %ecx
xorl %r15d, %r15d
cmpl %ecx, %r12d
je 0xe3eb
leaq -0x1(%r14), %rcx
movq 0x18(%rbx), %rdx
movq -0x10(%rdx,%rax,8), %rsi
movq %rsi, (%rdx,%rcx,8)
movq 0x18(%rbx), %rdx
movq -0x8(%rdx,%rax,8), %rax
movq %rax, (%rdx,%r14,8)
movq 0x18(%rbx), %rax
movq (%rax,%rcx,8), %rsi
movq %rbx, %rdi
movl %r14d, %edx
callq 0xe553
jmp 0xe3eb
movl 0x20(%rbx), %ecx
movl 0x24(%rbx), %eax
cmpl %ecx, %eax
jne 0xe3c5
leal (%rax,%rax), %ecx
cmpl $0x4, %eax
pushq $0x4
popq %rsi
cmovgel %ecx, %esi
movl %esi, 0x24(%rbx)
movq 0x18(%rbx), %rdi
shlq $0x3, %rsi
callq *0x24ed2(%rip)          # 0x33288
movq %rax, 0x18(%rbx)
movl 0x20(%rbx), %ecx
jmp 0xe3c9
pushq $0x1
popq %r15
jmp 0xe3eb
movq 0x18(%rbx), %rax
incl 0x10(%r12)
incl 0x10(%r14)
movslq %ecx, %rcx
movq %r12, (%rax,%rcx,8)
movq 0x18(%rbx), %rax
leal 0x2(%rcx), %edx
movl %edx, 0x20(%rbx)
movq %r14, 0x8(%rax,%rcx,8)
xorl %r15d, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq