// File: /workspace/github_c_makefile_star2_O3/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 0x44efe
leaq 0xbd42f(%rip), %rax     # 0x102310
movq 0x80(%rax), %rsi
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3c854
cmpl $0x2, %eax
jl 0x450ae
leaq 0x118(%rbx), %rax
movq %rax, 0x10(%rsp)
movl $0x1, %ebp
leaq 0x7c8d3(%rip), %r15     # 0xc17f2
leaq 0x7c8db(%rip), %r13     # 0xc1801
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 0x44fd1
movq %r12, %rdi
movq %r13, %rsi
callq 0x262f0
testl %eax, %eax
je 0x44ffc
movq %r12, %rdi
leaq 0x7c8f0(%rip), %rsi     # 0xc1852
callq 0x262f0
testl %eax, %eax
je 0x45028
movq %r12, %rdi
leaq 0x8c22c(%rip), %rsi     # 0xd11a5
callq 0x262f0
testl %eax, %eax
je 0x450d0
movq %r12, %rdi
leaq 0x7c8c7(%rip), %rsi     # 0xc1857
callq 0x262f0
testl %eax, %eax
jne 0x45132
leaq 0xbc904(%rip), %rax     # 0x1018a8
cmpq $0x0, 0x828(%rax)
je 0x450a1
leaq 0xbc8ef(%rip), %rax     # 0x1018a8
cmpq $0x0, 0x838(%rax)
je 0x450a1
callq 0x45213
jmp 0x450a1
movq 0x8(%r14,%rbp,8), %rsi
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
xorl %ecx, %ecx
callq 0x41718
testl %eax, %eax
jne 0x450c1
movl 0x8(%rsp), %eax
movl %eax, 0x114(%rbx)
jmp 0x450a1
movq 0x8(%r14,%rbp,8), %rax
movq 0x8(%rax), %rsi
movzbl -0x1(%rsi), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x45081
leaq 0x7c116(%rip), %rdi     # 0xc1130
movslq (%rdi,%rax,4), %rcx
addq %rdi, %rcx
jmpq *%rcx
shrl $0x3, %edx
jmp 0x45094
movq 0x8(%r14,%rbp,8), %rax
movq 0x8(%rax), %rdi
leaq 0x7786d(%rip), %rsi     # 0xbc8a5
callq 0x262f0
testl %eax, %eax
jne 0x450a1
orb $0x1, 0x148(%rbx)
jmp 0x450a1
movq -0x11(%rsi), %rcx
jmp 0x4505f
movzwl -0x5(%rsi), %ecx
jmp 0x4505f
movl -0x9(%rsi), %ecx
jmp 0x4505f
movzbl -0x3(%rsi), %ecx
decl %eax
cmpq $0x2d, %rcx
ja 0x45141
leaq 0x7c0e2(%rip), %rcx     # 0xc1154
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzbl -0x3(%rsi), %edx
jmp 0x45094
xorl %edx, %edx
jmp 0x45094
movl -0x9(%rsi), %edx
jmp 0x45094
movq -0x11(%rsi), %rdx
jmp 0x45094
movzwl -0x5(%rsi), %edx
incq %rdx
movq 0x10(%rsp), %rdi
callq 0x26c50
addq $0x2, %rbp
cmpl %ebp, 0x38(%rbx)
jg 0x44f26
leaq 0xbd25b(%rip), %rax     # 0x102310
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x3c854
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb $0x1, 0x98(%rbx)
je 0x450c1
movq 0x8(%r14,%rbp,8), %rdi
leaq 0x8(%rsp), %rsi
callq 0x415ca
testl %eax, %eax
jne 0x450c1
movq 0x8(%rsp), %rax
cmpq 0xd0(%rbx), %rax
jle 0x45101
movq %rax, 0xd0(%rbx)
leaq 0xbc7a0(%rip), %rax     # 0x1018a8
movq 0x978(%rax), %rax
movq %rax, 0xd8(%rbx)
cmpl $0x0, 0xa4(%rbx)
je 0x450c1
cmpl $0x9, 0xa0(%rbx)
jne 0x450c1
movq %rbx, %rdi
callq 0x4517c
jmp 0x450c1
leaq 0x7c725(%rip), %rsi     # 0xc185e
movq %rbx, %rdi
movq %r12, %rdx
jmp 0x45170
leaq 0x7bffc(%rip), %rcx     # 0xc1144
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzbl -0x3(%rsi), %edx
jmp 0x45166
movl -0x9(%rsi), %edx
jmp 0x45166
movq -0x11(%rsi), %rdx
jmp 0x45166
movzwl -0x5(%rsi), %edx
leaq 0x7c69f(%rip), %rsi     # 0xc180c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3cc2d
jmp 0x450c1