// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x38(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x4ef1c
movq -0x8(%rbp), %rdi
leaq 0x129d35(%rip), %rax    # 0x178c40
movq 0x80(%rax), %rsi
callq 0x42cc0
jmp 0x4f229
movl $0x1, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jge 0x4f215
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rdi
leaq 0xed170(%rip), %rsi     # 0x13c0be
callq 0x26300
cmpl $0x0, %eax
jne 0x4ef9d
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x49f20
cmpl $0x0, %eax
je 0x4ef88
jmp 0x4f229
movq -0x18(%rbp), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x114(%rax)
jmp 0x4f205
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rdi
leaq 0xed115(%rip), %rsi     # 0x13c0cd
callq 0x26300
cmpl $0x0, %eax
jne 0x4f057
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x4dc30
cmpq $0x2e, %rax
jae 0x4f027
movq -0x8(%rbp), %rax
addq $0x118, %rax            # imm = 0x118
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
callq 0x4dc30
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq %rax, %rdx
addq $0x1, %rdx
callq 0x26c60
jmp 0x4f052
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
callq 0x4dc30
movq -0x40(%rbp), %rdi
movq %rax, %rdx
leaq 0xed092(%rip), %rsi     # 0x13c0d8
movb $0x0, %al
callq 0x42fd0
jmp 0x4f229
jmp 0x4f203
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rdi
leaq 0xed0ac(%rip), %rsi     # 0x13c11e
callq 0x26300
cmpl $0x0, %eax
jne 0x4f0be
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rdi
leaq 0xe8779(%rip), %rsi     # 0x137815
callq 0x26300
cmpl $0x0, %eax
jne 0x4f0b9
movq -0x8(%rbp), %rax
movl 0x148(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x148(%rax)
jmp 0x4f201
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rdi
leaq 0xfbeac(%rip), %rsi     # 0x14af85
callq 0x26300
cmpl $0x0, %eax
jne 0x4f187
movq -0x8(%rbp), %rax
movl 0x98(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x4f0fe
jmp 0x4f229
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq -0x28(%rbp), %rsi
callq 0x49d70
cmpl $0x0, %eax
je 0x4f126
jmp 0x4f229
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0xd0(%rcx), %rax
jle 0x4f146
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xd0(%rax)
leaq 0x12908b(%rip), %rax    # 0x1781d8
movq 0x978(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xd8(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0xa4(%rax)
je 0x4f182
movq -0x8(%rbp), %rax
cmpl $0x9, 0xa0(%rax)
jne 0x4f182
movq -0x8(%rbp), %rdi
callq 0x4f230
jmp 0x4f229
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rdi
leaq 0xecf81(%rip), %rsi     # 0x13c123
callq 0x26300
cmpl $0x0, %eax
jne 0x4f1d5
leaq 0x129025(%rip), %rax    # 0x1781d8
cmpq $0x0, 0x828(%rax)
je 0x4f1d3
leaq 0x129014(%rip), %rax    # 0x1781d8
cmpq $0x0, 0x838(%rax)
je 0x4f1d3
callq 0x4f300
jmp 0x4f1fd
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rdx
leaq 0xecf36(%rip), %rsi     # 0x13c12a
movb $0x0, %al
callq 0x42fd0
jmp 0x4f229
jmp 0x4f1ff
jmp 0x4f201
jmp 0x4f203
jmp 0x4f205
jmp 0x4f207
movl -0xc(%rbp), %eax
addl $0x2, %eax
movl %eax, -0xc(%rbp)
jmp 0x4ef23
movq -0x8(%rbp), %rdi
leaq 0x129a20(%rip), %rax    # 0x178c40
movq 0x8(%rax), %rsi
callq 0x42cc0
addq $0x40, %rsp
popq %rbp
retq
nop