// File: /workspace/github_c_makefile_star2_O3/andyfighting[P]hiredis_timer_cmpt/./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 succeed. */
    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
movl $0x4, %ecx
movl $0x4, %eax
testq %rdx, %rdx
je 0x7fe7
cmpq %rdx, 0x20(%rbx)
jne 0x80e6
leaq (%rdx,%rdx), %rax
movabsq $0x7ffffffffffffffe, %r12 # imm = 0x7FFFFFFFFFFFFFFE
cmpq %r12, %rax
jbe 0x7fe7
incq %r12
movq %rdx, %rbp
jmp 0x7ff6
movq %rcx, %r12
addq %rcx, %rcx
cmpq %rax, %r12
jb 0x7fe7
movq 0x20(%rbx), %rbp
cmpq %rax, %rbp
ja 0x8189
movq %r13, 0x20(%rsp)
movq 0x8(%rbx), %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq -0x1(%r12), %r14
movl $0x8, %esi
movq %r12, %rdi
movq %rdx, %r13
callq 0x3290
movq %r13, %rdx
movq %rax, %r13
movq %rbp, 0x8(%rsp)
movq %rbp, %rax
testq %rdx, %rdx
je 0x80a8
xorl %esi, %esi
movq 0x8(%rsp), %rax
movq %r15, 0x28(%rsp)
testq %rax, %rax
je 0x80b1
movq (%rbx), %rcx
movq (%rcx,%rsi,8), %rbp
testq %rbp, %rbp
je 0x80a0
movq %rsi, 0x30(%rsp)
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 %r15, %r15
jne 0x8060
movq 0x10(%rbx), %rdx
movq 0x28(%rsp), %r15
movq 0x30(%rsp), %rsi
incq %rsi
cmpq %rdx, %rsi
jb 0x804a
testq %rax, %rax
jne 0x81f4
movq (%rbx), %rdi
callq 0x3050
movq %r13, (%rbx)
movq 0x18(%rsp), %rcx
movq %rcx, 0x8(%rbx)
movq %r12, 0x10(%rbx)
movq %r14, 0x18(%rbx)
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x28(%rbx)
movq 0x20(%rsp), %r13
jmp 0x80ea
movq 0x8(%rbx), %rcx
movq %r15, %rdi
callq *(%rcx)
movl %eax, %r12d
andl 0x18(%rbx), %r12d
movq (%rbx), %rax
movq (%rax,%r12,8), %r14
testq %r14, %r14
je 0x812c
movq 0x8(%rbx), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x8121
movq 0x28(%rbx), %rdi
movq (%r14), %rdx
movq %r15, %rsi
callq *%rax
testl %eax, %eax
je 0x8126
jmp 0x8189
cmpq %r15, (%r14)
je 0x8189
movq 0x10(%r14), %r14
jmp 0x80fd
cmpl $-0x1, %r12d
je 0x8189
movq %r13, %r14
movl $0x18, %edi
callq 0x3340
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 0x8171
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 0x81d3
movq 0x28(%rbx), %rdi
movq %r14, %rsi
callq *%rax
jmp 0x81d6
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7ea8
movq %rax, %r12
movq 0x8(%rax), %r15
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rcx
testq %rcx, %rcx
je 0x81b8
movq 0x28(%rbx), %rdi
movq %r13, %rsi
callq *%rcx
movq %rax, %r13
movq 0x8(%rbx), %rax
movq %r13, 0x8(%r12)
movq 0x28(%rax), %rax
xorl %ebp, %ebp
testq %rax, %rax
je 0x81e3
movq 0x28(%rbx), %rdi
movq %r15, %rsi
callq *%rax
jmp 0x81e3
movq %r14, %rax
movq %rax, 0x8(%r13)
incq 0x20(%rbx)
movl $0x1, %ebp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x15c2(%rip), %rdi      # 0x97bd
leaq 0x15c9(%rip), %rsi      # 0x97cb
leaq 0x15cb(%rip), %rcx      # 0x97d4
movl $0x7e, %edx
callq 0x31b0
nop