// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/replication.c
// Function: replconfCommand
void replconfCommand(client *c) {
    int j;

    if ((c->argc % 2) == 0) {
        /* Number of arguments must be odd to make sure that every
         * option has a corresponding value. */
        addReply(c,shared.syntaxerr);
        return;
    }

    /* Process every option-value pair. */
    for (j = 1; j < c->argc; j+=2) {
        if (!strcasecmp(c->argv[j]->ptr,"listening-port")) {
            long port;

            if ((getLongFromObjectOrReply(c,c->argv[j+1],
                    &port,NULL) != C_OK))
                return;
            c->slave_listening_port = port;
        } else if (!strcasecmp(c->argv[j]->ptr,"ip-address")) {
            sds ip = c->argv[j+1]->ptr;
            if (sdslen(ip) < sizeof(c->slave_ip)) {
                memcpy(c->slave_ip,ip,sdslen(ip)+1);
            } else {
                addReplyErrorFormat(c,"REPLCONF ip-address provided by "
                    "slave instance is too long: %zd bytes", sdslen(ip));
                return;
            }
        } else if (!strcasecmp(c->argv[j]->ptr,"capa")) {
            /* Ignore capabilities not understood by this master. */
            if (!strcasecmp(c->argv[j+1]->ptr,"eof"))
                c->slave_capa |= SLAVE_CAPA_EOF;
        } else if (!strcasecmp(c->argv[j]->ptr,"ack")) {
            /* REPLCONF ACK is used by slave to inform the master the amount
             * of replication stream that it processed so far. It is an
             * internal only command that normal clients should never use. */
            long long offset;

            if (!(c->flags & CLIENT_SLAVE)) return;
            if ((getLongLongFromObject(c->argv[j+1], &offset) != C_OK))
                return;
            if (offset > c->repl_ack_off)
                c->repl_ack_off = offset;
            c->repl_ack_time = server.unixtime;
            /* If this was a diskless replication, we need to really put
             * the slave online when the first ACK is received (which
             * confirms slave is online and ready to get more data). */
            if (c->repl_put_online_on_ack && c->replstate == SLAVE_STATE_ONLINE)
                putSlaveOnline(c);
            /* Note: this command does not reply anything! */
            return;
        } else if (!strcasecmp(c->argv[j]->ptr,"getack")) {
            /* REPLCONF GETACK is used in order to request an ACK ASAP
             * to the slave. */
            if (server.masterhost && server.master) replicationSendAck();
            /* Note: this command does not reply anything! */
        } else {
            addReplyErrorFormat(c,"Unrecognized REPLCONF option: %s",
                (char*)c->argv[j]->ptr);
            return;
        }
    }
    addReply(c,shared.ok);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl 0x38(%rdi), %eax
testb $0x1, %al
jne 0x3dc08
leaq 0xbc725(%rip), %rax     # 0xfa310
movq 0x80(%rax), %rsi
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x36987
leaq 0x118(%rbx), %rcx
movq %rcx, 0x10(%rsp)
pushq $0x1
popq %rbp
leaq 0x75324(%rip), %r15     # 0xb2f42
leaq 0x7532c(%rip), %r13     # 0xb2f51
cltq
cmpq %rax, %rbp
jge 0x3dd58
movq 0x40(%rbx), %r14
movq (%r14,%rbp,8), %rax
movq 0x8(%rax), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x262f0
testl %eax, %eax
je 0x3dcd4
movq %r12, %rdi
movq %r13, %rsi
callq 0x262f0
testl %eax, %eax
je 0x3dcfc
movq %r12, %rdi
leaq 0x75336(%rip), %rsi     # 0xb2fa2
callq 0x262f0
testl %eax, %eax
je 0x3dd2c
movq %r12, %rdi
leaq 0x83fe2(%rip), %rsi     # 0xc1c65
callq 0x262f0
testl %eax, %eax
je 0x3dd70
movq %r12, %rdi
leaq 0x7530d(%rip), %rsi     # 0xb2fa7
callq 0x262f0
testl %eax, %eax
jne 0x3ddd2
leaq 0xbbbfa(%rip), %rax     # 0xf98a8
cmpq $0x0, 0x828(%rax)
je 0x3dd4c
leaq 0xbbbe5(%rip), %rax     # 0xf98a8
cmpq $0x0, 0x838(%rax)
je 0x3dd4c
callq 0x3de95
jmp 0x3dd4c
movq 0x8(%r14,%rbp,8), %rsi
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
xorl %ecx, %ecx
callq 0x3ab5e
testl %eax, %eax
jne 0x3ddf5
movl 0x8(%rsp), %eax
movl %eax, 0x114(%rbx)
jmp 0x3dd4c
movq 0x8(%r14,%rbp,8), %rax
movq 0x8(%rax), %r12
movq %r12, %rdi
callq 0x3cf20
cmpq $0x2d, %rax
ja 0x3dde1
incq %rax
movq 0x10(%rsp), %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x26c50
jmp 0x3dd4c
movq 0x8(%r14,%rbp,8), %rax
movq 0x8(%rax), %rdi
leaq 0x70a59(%rip), %rsi     # 0xae795
callq 0x262f0
testl %eax, %eax
jne 0x3dd4c
orb $0x1, 0x148(%rbx)
addq $0x2, %rbp
movl 0x38(%rbx), %eax
jmp 0x3dc25
leaq 0xbc5b1(%rip), %rax     # 0xfa310
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x36987
jmp 0x3ddf5
testb $0x1, 0x98(%rbx)
je 0x3ddf5
movq 0x8(%r14,%rbp,8), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3aa55
testl %eax, %eax
jne 0x3ddf5
movq 0x8(%rsp), %rax
cmpq 0xd0(%rbx), %rax
jle 0x3dda1
movq %rax, 0xd0(%rbx)
leaq 0xbbb00(%rip), %rax     # 0xf98a8
movq 0x978(%rax), %rax
movq %rax, 0xd8(%rbx)
cmpl $0x0, 0xa4(%rbx)
je 0x3ddf5
cmpl $0x9, 0xa0(%rbx)
jne 0x3ddf5
movq %rbx, %rdi
callq 0x3de04
jmp 0x3ddf5
leaq 0x751d5(%rip), %rsi     # 0xb2fae
movq %rbx, %rdi
movq %r12, %rdx
jmp 0x3ddee
leaq 0x75174(%rip), %rsi     # 0xb2f5c
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x36b96
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq