// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/deps/hiredis/./dict.c
// Function: dictReplace
static int dictReplace(dict *ht, void *key, void *val) {
    dictEntry *entry, auxentry;

    /* Try to add the element. If the key
     * does not exists dictAdd will suceed. */
    if (dictAdd(ht, key, val) == DICT_OK)
        return 1;
    /* It already exists, get the entry */
    entry = dictFind(ht, key);
    /* Free the old value and set the new one */
    /* Set the new value and free the old one. Note that it is important
     * to do that in this order, as the value may just be exactly the same
     * as the previous one. In this context, think to reference counting,
     * you want to increment (set), and then decrement (free), and not the
     * reverse. */
    auxentry = *entry;
    dictSetHashVal(ht, entry, val);
    dictFreeEntryVal(ht, &auxentry);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %rbx
movq 0x10(%rdi), %rdx
pushq $0x4
popq %rcx
movq %rcx, %rax
testq %rdx, %rdx
je 0x75d2a
cmpq %rdx, 0x20(%rbx)
jne 0x75dde
leaq (%rdx,%rdx), %rax
movabsq $0x7ffffffffffffffe, %r12 # imm = 0x7FFFFFFFFFFFFFFE
cmpq %r12, %rax
jbe 0x75d2a
incq %r12
movq %rdx, %rbp
jmp 0x75d39
movq %rcx, %r12
addq %rcx, %rcx
cmpq %rax, %r12
jb 0x75d2a
movq 0x20(%rbx), %rbp
cmpq %rax, %rbp
ja 0x75ec9
movq %r13, 0x28(%rsp)
movq 0x8(%rbx), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq -0x1(%r12), %r14
pushq $0x8
popq %rsi
movq %r12, %rdi
movq %rdx, %r13
callq 0x269c0
movq %r13, %rdx
movq %rax, %r13
movq %rbp, 0x18(%rsp)
movq %rbp, %rax
xorl %esi, %esi
movq %r15, 0x20(%rsp)
cmpq %rdx, %rsi
jae 0x75de4
testq %rax, %rax
je 0x75ded
movq (%rbx), %rcx
movq %rsi, 0x30(%rsp)
movq (%rcx,%rsi,8), %rbp
testq %rbp, %rbp
jne 0x75dcb
jmp 0x75dd4
movq (%rbp), %rdi
movq 0x10(%rbp), %r15
movq 0x8(%rbx), %rax
callq *(%rax)
andl %r14d, %eax
movq (%r13,%rax,8), %rcx
movq %rcx, 0x10(%rbp)
movq %rbp, (%r13,%rax,8)
movq 0x20(%rbx), %rax
decq %rax
movq %rax, 0x20(%rbx)
movq %r15, %rbp
testq %rbp, %rbp
jne 0x75d9e
movq 0x10(%rbx), %rdx
movq 0x30(%rsp), %rsi
incq %rsi
jmp 0x75d81
movq 0x8(%rbx), %rcx
jmp 0x75e25
testq %rax, %rax
jne 0x75f37
movq (%rbx), %rdi
callq 0x264d0
movq %r13, (%rbx)
movq 0x10(%rsp), %rcx
movq %rcx, 0x8(%rbx)
movq %r12, 0x10(%rbx)
movq %r14, 0x18(%rbx)
movq 0x18(%rsp), %rax
movq %rax, 0x20(%rbx)
movq 0x8(%rsp), %rax
movq %rax, 0x28(%rbx)
movq 0x28(%rsp), %r13
movq 0x20(%rsp), %r15
movq %r15, %rdi
callq *(%rcx)
movl %eax, %r12d
andl 0x18(%rbx), %r12d
leaq (,%r12,8), %r14
addq (%rbx), %r14
movq (%r14), %r14
testq %r14, %r14
je 0x75e6e
movq 0x8(%rbx), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x75e63
movq 0x28(%rbx), %rdi
movq (%r14), %rdx
movq %r15, %rsi
callq *%rax
testl %eax, %eax
je 0x75e68
jmp 0x75ec9
cmpq %r15, (%r14)
je 0x75ec9
addq $0x10, %r14
jmp 0x75e3c
cmpl $-0x1, %r12d
je 0x75ec9
movq %r13, %r14
pushq $0x18
popq %rdi
callq 0x26360
movq %rax, %r13
movq (%rbx), %rax
movslq %r12d, %rcx
movq (%rax,%rcx,8), %rdx
movq %rdx, 0x10(%r13)
movq %r13, (%rax,%rcx,8)
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rcx
testq %rcx, %rcx
je 0x75eb1
movq 0x28(%rbx), %rdi
movq %r15, %rsi
callq *%rcx
movq %rax, %r15
movq 0x8(%rbx), %rax
movq %r15, (%r13)
movq 0x10(%rax), %rax
testq %rax, %rax
je 0x75f1d
movq 0x28(%rbx), %rdi
movq %r14, %rsi
callq *%rax
jmp 0x75f20
movq %rbx, %rdi
movq %r15, %rsi
callq 0x75bf0
movq %rax, %r12
movq 0x8(%rax), %r15
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rcx
testq %rcx, %rcx
je 0x75ef8
movq 0x28(%rbx), %rdi
movq %r13, %rsi
callq *%rcx
movq %rax, %r13
movq 0x8(%rbx), %rax
movq %r13, 0x8(%r12)
movq 0x28(%rax), %rax
testq %rax, %rax
je 0x75f28
movq 0x28(%rbx), %rdi
movq %r15, %rsi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
movq %r14, %rax
movq %rax, 0x8(%r13)
incq 0x20(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4a6c9(%rip), %rdi     # 0xc0607
leaq 0x4a6d0(%rip), %rsi     # 0xc0615
leaq 0x4a6d2(%rip), %rcx     # 0xc061e
pushq $0x7e
popq %rdx
callq 0x262d0