// File: /workspace/github_c_makefile_star2_O1/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 0xf2e9
movq %rcx, %r14
movq %rbx, %rdi
movq %r12, %rsi
callq 0x198c3
testl %eax, %eax
je 0xf390
incl 0x10(%r14)
movq 0x18(%rbx), %rcx
movslq %eax, %r12
movq (%rcx,%r12,8), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0xf2dc
movq %r15, %rdi
callq 0x759a
movq 0x18(%rbx), %rax
movq %r14, (%rax,%r12,8)
jmp 0xf3e6
movq %rbx, %rdi
movq %r12, %rsi
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
callq 0xf564
testl %eax, %eax
je 0xf3f5
movl %eax, %r12d
movq 0x18(%rbx), %rax
movslq %r12d, %r14
movq -0x8(%rax,%r14,8), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0xf326
movq %r15, %rdi
callq 0x759a
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 0xf344
movq %r15, %rdi
callq 0x759a
movslq 0x20(%rbx), %rax
leal -0x2(%rax), %ecx
movl %ecx, 0x20(%rbx)
leal -0x1(%rax), %ecx
xorl %r15d, %r15d
cmpl %ecx, %r12d
je 0xf3e9
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 0xf564
jmp 0xf3e9
movl 0x24(%rbx), %eax
cmpl 0x20(%rbx), %eax
jne 0xf3bb
leal (%rax,%rax), %ecx
cmpl $0x4, %eax
movl $0x4, %esi
cmovgel %ecx, %esi
movl %esi, 0x24(%rbx)
movq 0x18(%rbx), %rdi
shlq $0x3, %rsi
callq *0x28ed1(%rip)          # 0x38288
movq %rax, 0x18(%rbx)
incl 0x10(%r12)
incl 0x10(%r14)
movq 0x18(%rbx), %rax
movslq 0x20(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movl %edx, 0x20(%rbx)
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
movl $0x1, %r15d
jmp 0xf3e9