// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
leaq -0x30(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x49ea0
cmpl $0x0, %eax
je 0x4c8d2
jmp 0x4cac0
cmpl $0x0, -0x14(%rbp)
jne 0x4c8e4
imulq $0x3e8, -0x30(%rbp), %rax # imm = 0x3E8
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x4a6f0
cmpq $0x0, %rax
jne 0x4c920
movq -0x8(%rbp), %rdi
leaq 0x12c32e(%rip), %rax    # 0x178c40
movq 0x20(%rax), %rsi
callq 0x42cc0
jmp 0x4cac0
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
callq 0x2ff70
movq %rax, %rcx
movq -0x40(%rbp), %rax
cmpq %rcx, %rax
jg 0x4ca46
leaq 0x12b894(%rip), %rax    # 0x1781d8
cmpl $0x0, 0x31c(%rax)
jne 0x4ca46
leaq 0x12b880(%rip), %rax    # 0x1781d8
cmpq $0x0, 0x828(%rax)
jne 0x4ca46
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x4ac10
cmpl $0x0, %eax
je 0x4c97e
jmp 0x4c9a9
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq 0xef0af(%rip), %rdx     # 0x13ba3c
leaq 0xf080e(%rip), %rcx     # 0x13d1a2
movl $0x3c8, %r8d            # imm = 0x3C8
callq 0x78360
movl $0x1, %edi
callq 0x263c0
leaq 0x12b828(%rip), %rax    # 0x1781d8
movq 0x720(%rax), %rcx
addq $0x1, %rcx
leaq 0x12b816(%rip), %rax    # 0x1781d8
movq %rcx, 0x720(%rax)
leaq 0xeb634(%rip), %rdi     # 0x138004
movl $0x3, %esi
callq 0x486a0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x2, %esi
movb $0x0, %al
callq 0x46840
movq -0x38(%rbp), %rdi
callq 0x48f70
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x4aa60
movq -0x20(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x30(%rax), %ecx
movl $0x4, %edi
leaq 0xeca6d(%rip), %rsi     # 0x139498
callq 0x9ce20
movq -0x8(%rbp), %rdi
leaq 0x12c205(%rip), %rax    # 0x178c40
movq 0x28(%rax), %rsi
callq 0x42cc0
jmp 0x4cac0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x4c4f0
movq -0x8(%rbp), %rdi
leaq 0x12c1da(%rip), %rax    # 0x178c40
movq 0x28(%rax), %rsi
callq 0x42cc0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x4aa60
movq -0x20(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x30(%rax), %ecx
movl $0x4, %edi
leaq 0xfc617(%rip), %rsi     # 0x1490b2
callq 0x9ce20
leaq 0x12b731(%rip), %rax    # 0x1781d8
movq 0x720(%rax), %rcx
addq $0x1, %rcx
leaq 0x12b71f(%rip), %rax    # 0x1781d8
movq %rcx, 0x720(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)