// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/bitops.c
// Function: setbitCommand
void setbitCommand(client *c) {
    robj *o;
    char *err = "bit is not an integer or out of range";
    size_t bitoffset;
    ssize_t byte, bit;
    int byteval, bitval;
    long on;

    if (getBitOffsetFromArgument(c,c->argv[2],&bitoffset,0,0) != C_OK)
        return;

    if (getLongFromObjectOrReply(c,c->argv[3],&on,err) != C_OK)
        return;

    /* Bits can only be set or cleared... */
    if (on & ~1) {
        addReplyError(c,err);
        return;
    }

    if ((o = lookupStringForBitCommand(c,bitoffset)) == NULL) return;

    /* Get current values */
    byte = bitoffset >> 3;
    byteval = ((uint8_t*)o->ptr)[byte];
    bit = 7 - (bitoffset & 0x7);
    bitval = byteval & (1 << bit);

    /* Update byte with new bit value and return original value */
    byteval &= ~(1 << bit);
    byteval |= ((on & 0x1) << bit);
    ((uint8_t*)o->ptr)[byte] = byteval;
    signalModifiedKey(c->db,c->argv[1]);
    notifyKeyspaceEvent(NOTIFY_STRING,"setbit",c->argv[1],c->db->id);
    server.dirty++;
    addReply(c, bitval ? shared.cone : shared.czero);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
leaq 0xb4ce2(%rip), %rax     # 0x145e75
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rsi
leaq -0x20(%rbp), %rdx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x90d00
cmpl $0x0, %eax
je 0x911c0
jmp 0x9134d
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x18(%rax), %rsi
movq -0x18(%rbp), %rcx
leaq -0x40(%rbp), %rdx
callq 0x49f20
cmpl $0x0, %eax
je 0x911e7
jmp 0x9134d
movq -0x40(%rbp), %rax
andq $-0x2, %rax
cmpq $0x0, %rax
je 0x91207
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x42f90
jmp 0x9134d
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x90fa0
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
jne 0x91223
jmp 0x9134d
movq -0x20(%rbp), %rax
shrq $0x3, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x28(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rcx
andq $0x7, %rcx
movl $0x7, %eax
subq %rcx, %rax
movq %rax, -0x30(%rbp)
movl -0x34(%rbp), %eax
movq -0x30(%rbp), %rcx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
movl %eax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movl %eax, %ecx
movl $0x1, %eax
shll %cl, %eax
xorl $-0x1, %eax
andl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x40(%rbp), %rax
andq $0x1, %rax
movq -0x30(%rbp), %rcx
shlq %cl, %rax
movq %rax, %rcx
movslq -0x34(%rbp), %rax
orq %rcx, %rax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x28(%rbp), %rcx
movb %dl, (%rax,%rcx)
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 0xa6203(%rip), %rsi     # 0x1374f0
callq 0x9ce20
leaq 0xe6edf(%rip), %rax     # 0x1781d8
movq 0x720(%rax), %rcx
addq $0x1, %rcx
leaq 0xe6ecd(%rip), %rax     # 0x1781d8
movq %rcx, 0x720(%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpl $0x0, -0x38(%rbp)
je 0x91331
leaq 0xe7919(%rip), %rax     # 0x178c40
movq 0x28(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x91340
leaq 0xe7908(%rip), %rax     # 0x178c40
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x42cc0
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)