// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/db.c
// Function: expireGenericCommand
void expireGenericCommand(client *c, long long basetime, int unit) {
    robj *key = c->argv[1], *param = c->argv[2];
    long long when; /* unix time in milliseconds when the key will expire. */

    if (getLongLongFromObjectOrReply(c, param, &when, NULL) != C_OK)
        return;

    if (unit == UNIT_SECONDS) when *= 1000;
    when += basetime;

    /* No key, return zero. */
    if (lookupKeyWrite(c->db,key) == NULL) {
        addReply(c,shared.czero);
        return;
    }

    /* EXPIRE with negative TTL, or EXPIREAT with a timestamp into the past
     * should never be executed as a DEL when load the AOF or in the context
     * of a slave instance.
     *
     * Instead we take the other branch of the IF statement setting an expire
     * (possibly in the past) and wait for an explicit DEL from the master. */
    if (when <= mstime() && !server.loading && !server.masterhost) {
        robj *aux;

        serverAssertWithInfo(c,key,dbDelete(c->db,key));
        server.dirty++;

        /* Replicate/AOF this as an explicit DEL. */
        aux = createStringObject("DEL",3);
        rewriteClientCommandVector(c,2,aux,key);
        decrRefCount(aux);
        signalModifiedKey(c->db,key);
        notifyKeyspaceEvent(NOTIFY_GENERIC,"del",key,c->db->id);
        addReply(c, shared.cone);
        return;
    } else {
        setExpire(c->db,key,when);
        addReply(c,shared.cone);
        signalModifiedKey(c->db,key);
        notifyKeyspaceEvent(NOTIFY_GENERIC,"expire",key,c->db->id);
        server.dirty++;
        return;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x40(%rdi), %rax
movq 0x8(%rax), %r14
movq 0x10(%rax), %rsi
leaq 0x8(%rsp), %rdx
xorl %ecx, %ecx
callq 0x3ab03
testl %eax, %eax
jne 0x3c546
movq 0x8(%rsp), %rax
imulq $0x3e8, %rax, %rcx      # imm = 0x3E8
testl %ebp, %ebp
cmovneq %rax, %rcx
addq %r15, %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x3aec2
testq %rax, %rax
je 0x3c4e5
movq 0x8(%rsp), %r12
callq 0x2b8ae
leaq 0xbd462(%rip), %r15     # 0xf98a8
movq 0x10(%rbx), %rdi
cmpq %rax, %r12
jg 0x3c4fa
cmpl $0x0, 0x31c(%r15)
jne 0x3c4fa
cmpq $0x0, 0x828(%r15)
jne 0x3c4fa
movq %r14, %rsi
callq 0x3b1df
testl %eax, %eax
je 0x3c553
incq 0x720(%r15)
leaq 0x72af7(%rip), %rdi     # 0xaef84
pushq $0x3
popq %rsi
callq 0x39e29
movq %rax, %r15
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x38eb8
movq %r15, %rdi
callq 0x3a265
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x572df
movq 0x10(%rbx), %rax
movl 0x30(%rax), %ecx
leaq 0x73f4b(%rip), %rsi     # 0xb0418
pushq $0x4
popq %rdi
movq %r14, %rdx
callq 0x6fb58
leaq 0xbde31(%rip), %rax     # 0xfa310
movq 0x28(%rax), %rsi
jmp 0x3c4f0
leaq 0xbde24(%rip), %rax     # 0xfa310
movq 0x20(%rax), %rsi
movq %rbx, %rdi
callq 0x36987
jmp 0x3c546
movq 0x8(%rsp), %rdx
movq %r14, %rsi
callq 0x3c14f
leaq 0xbde02(%rip), %rax     # 0xfa310
movq 0x28(%rax), %rsi
movq %rbx, %rdi
callq 0x36987
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x572df
movq 0x10(%rbx), %rax
movl 0x30(%rax), %ecx
leaq 0x8399f(%rip), %rsi     # 0xbfed3
pushq $0x4
popq %rdi
movq %r14, %rdx
callq 0x6fb58
incq 0x720(%r15)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x76382(%rip), %rdx     # 0xb28dc
leaq 0x77b6e(%rip), %rcx     # 0xb40cf
movq %rbx, %rdi
movq %r14, %rsi
movl $0x3c8, %r8d            # imm = 0x3C8
callq 0x588a4
pushq $0x1
popq %rdi
callq 0x263c0