// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x4
popq %rcx
movq %rcx, %rax
testq %rdx, %rdx
je 0x7469
cmpq %rdx, 0x20(%rbx)
jne 0x751d
leaq (%rdx,%rdx), %rax
movabsq $0x7ffffffffffffffe, %r12 # imm = 0x7FFFFFFFFFFFFFFE
cmpq %r12, %rax
jbe 0x7469
incq %r12
movq %rdx, %rbp
jmp 0x7478
movq %rcx, %r12
addq %rcx, %rcx
cmpq %rax, %r12
jb 0x7469
movq 0x20(%rbx), %rbp
cmpq %rax, %rbp
ja 0x7608
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 0x32a0
movq %r13, %rdx
movq %rax, %r13
movq %rbp, 0x18(%rsp)
movq %rbp, %rax
xorl %esi, %esi
movq %r15, 0x20(%rsp)
cmpq %rdx, %rsi
jae 0x7523
testq %rax, %rax
je 0x752c
movq (%rbx), %rcx
movq %rsi, 0x30(%rsp)
movq (%rcx,%rsi,8), %rbp
testq %rbp, %rbp
jne 0x750a
jmp 0x7513
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 0x74dd
movq 0x10(%rbx), %rdx
movq 0x30(%rsp), %rsi
incq %rsi
jmp 0x74c0
movq 0x8(%rbx), %rcx
jmp 0x7564
testq %rax, %rax
jne 0x7671
movq (%rbx), %rdi
callq 0x3050
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 0x75ad
movq 0x8(%rbx), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x75a2
movq 0x28(%rbx), %rdi
movq (%r14), %rdx
movq %r15, %rsi
callq *%rax
testl %eax, %eax
je 0x75a7
jmp 0x7608
cmpq %r15, (%r14)
je 0x7608
addq $0x10, %r14
jmp 0x757b
cmpl $-0x1, %r12d
je 0x7608
movq %r13, %r14
pushq $0x18
popq %rdi
callq 0x3350
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 0x75f0
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 0x7652
movq 0x28(%rbx), %rdi
movq %r14, %rsi
callq *%rax
jmp 0x7655
movq %rbx, %rdi
movq %r15, %rsi
callq 0x732f
movq %rax, %r12
movq 0x8(%rax), %r15
movq 0x8(%rbx), %rax
movq 0x10(%rax), %rcx
testq %rcx, %rcx
je 0x7637
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 0x7660
movq 0x28(%rbx), %rdi
movq %r15, %rsi
callq *%rax
jmp 0x7660
movq %r14, %rax
movq %rax, 0x8(%r13)
incq 0x20(%rbx)
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x213c(%rip), %rdi      # 0x97b4
leaq 0x2143(%rip), %rsi      # 0x97c2
leaq 0x2145(%rip), %rcx      # 0x97cb
pushq $0x7e
popq %rdx
callq 0x31c0
nop