// File: /workspace/github_c_makefile_star2_O3/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 0x416bb
testl %eax, %eax
jne 0x434f3
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), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x41a1e
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x4195c
testq %rax, %rax
je 0x43490
movq 0x8(%rsp), %r12
callq 0x2ffce
leaq 0xbe4bd(%rip), %r15     # 0x1018a8
movq 0x10(%rbx), %rdi
cmpq %rax, %r12
jg 0x434a5
cmpl $0x0, 0x31c(%r15)
jne 0x434a5
cmpq $0x0, 0x828(%r15)
jne 0x434a5
movq %r14, %rsi
callq 0x41e5f
testl %eax, %eax
je 0x43500
incq 0x720(%r15)
leaq 0x79c62(%rip), %rdi     # 0xbd094
movl $0x3, %esi
callq 0x40744
movq %rax, %r15
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x3f61d
movq %r15, %rdi
callq 0x40c8f
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x60fd1
movq 0x10(%rbx), %rax
movl 0x30(%rax), %ecx
leaq 0x7b0b2(%rip), %rsi     # 0xbe528
movl $0x4, %edi
movq %r14, %rdx
callq 0x7c665
leaq 0xbee86(%rip), %rax     # 0x102310
movq 0x28(%rax), %rsi
jmp 0x4349b
leaq 0xbee79(%rip), %rax     # 0x102310
movq 0x20(%rax), %rsi
movq %rbx, %rdi
callq 0x3c854
jmp 0x434f3
movq 0x8(%rsp), %rdx
movq %r14, %rsi
callq 0x430b0
leaq 0xbee57(%rip), %rax     # 0x102310
movq 0x28(%rax), %rsi
movq %rbx, %rdi
callq 0x3c854
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x60fd1
movq 0x10(%rbx), %rax
movl 0x30(%rax), %ecx
leaq 0x8be2c(%rip), %rsi     # 0xcf30b
movl $0x4, %edi
movq %r14, %rdx
callq 0x7c665
incq 0x720(%r15)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7dbd9(%rip), %rdx     # 0xc10e0
leaq 0x7f501(%rip), %rcx     # 0xc2a0f
movq %rbx, %rdi
movq %r14, %rsi
movl $0x3c8, %r8d            # imm = 0x3C8
callq 0x627c3
movl $0x1, %edi
callq 0x263c0