// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/t_string.c
// Function: incrDecrCommand
void incrDecrCommand(client *c, long long incr) {
    long long value, oldvalue;
    robj *o, *new;

    o = lookupKeyWrite(c->db,c->argv[1]);
    if (o != NULL && checkType(c,o,OBJ_STRING)) return;
    if (getLongLongFromObjectOrReply(c,o,&value,NULL) != C_OK) return;

    oldvalue = value;
    if ((incr < 0 && oldvalue < 0 && incr < (LLONG_MIN-oldvalue)) ||
        (incr > 0 && oldvalue > 0 && incr > (LLONG_MAX-oldvalue))) {
        addReplyError(c,"increment or decrement would overflow");
        return;
    }
    value += incr;

    if (o && o->refcount == 1 && o->encoding == OBJ_ENCODING_INT &&
        (value < 0 || value >= OBJ_SHARED_INTEGERS) &&
        value >= LONG_MIN && value <= LONG_MAX)
    {
        new = o;
        o->ptr = (void*)((long)value);
    } else {
        new = createStringObjectFromLongLong(value);
        if (o) {
            dbOverwrite(c->db,c->argv[1],new);
        } else {
            dbAdd(c->db,c->argv[1],new);
        }
    }
    signalModifiedKey(c->db,c->argv[1]);
    notifyKeyspaceEvent(NOTIFY_STRING,"incrby",c->argv[1],c->db->id);
    server.dirty++;
    addReply(c,shared.colon);
    addReply(c,new);
    addReply(c,shared.crlf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x4a6f0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x587ed
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
xorl %edx, %edx
callq 0x490a0
cmpl $0x0, %eax
je 0x587ed
jmp 0x589cf
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
leaq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x49ea0
cmpl $0x0, %eax
je 0x5880c
jmp 0x589cf
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
jge 0x58839
cmpq $0x0, -0x20(%rbp)
jge 0x58839
movq -0x10(%rbp), %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
subq -0x20(%rbp), %rcx
cmpq %rcx, %rax
jl 0x5885e
cmpq $0x0, -0x10(%rbp)
jle 0x58873
cmpq $0x0, -0x20(%rbp)
jle 0x58873
movq -0x10(%rbp), %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
subq -0x20(%rbp), %rcx
cmpq %rcx, %rax
jle 0x58873
movq -0x8(%rbp), %rdi
leaq 0xe50ab(%rip), %rsi     # 0x13d914
callq 0x42f90
jmp 0x589cf
movq -0x10(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x588e8
movq -0x28(%rbp), %rax
cmpl $0x1, 0x4(%rax)
jne 0x588e8
movq -0x28(%rbp), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x1, %eax
jne 0x588e8
cmpq $0x0, -0x18(%rbp)
jl 0x588b2
cmpq $0x2710, -0x18(%rbp)    # imm = 0x2710
jl 0x588e8
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
cmpq %rax, -0x18(%rbp)
jl 0x588e8
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rax, -0x18(%rbp)
jg 0x588e8
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x5893a
movq -0x18(%rbp), %rdi
callq 0x486f0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x5891b
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x30(%rbp), %rdx
callq 0x4a8e0
jmp 0x58938
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x30(%rbp), %rdx
callq 0x4a7d0
jmp 0x5893a
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x4aa60
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x30(%rax), %ecx
movl $0x8, %edi
leaq 0xded80(%rip), %rsi     # 0x1376f6
callq 0x9ce20
leaq 0x11f856(%rip), %rax    # 0x1781d8
movq 0x720(%rax), %rcx
addq $0x1, %rcx
leaq 0x11f844(%rip), %rax    # 0x1781d8
movq %rcx, 0x720(%rax)
movq -0x8(%rbp), %rdi
leaq 0x12029a(%rip), %rax    # 0x178c40
movq 0x48(%rax), %rsi
callq 0x42cc0
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x42cc0
movq -0x8(%rbp), %rdi
leaq 0x120279(%rip), %rax    # 0x178c40
movq (%rax), %rsi
callq 0x42cc0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)