// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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
testb $0x1, 0x38(%rdi)
jne 0x4813f
leaq 0xbf18e(%rip), %rax     # 0x1072b0
movq 0x80(%rax), %rsi
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3fc19
cmpl $0x2, 0x38(%rbx)
jl 0x48358
leaq 0x118(%rbx), %rax
movq %rax, 0x10(%rsp)
movl $0x1, %r12d
leaq 0x7c5fc(%rip), %r15     # 0xc475e
leaq 0x7c604(%rip), %r13     # 0xc476d
movq 0x40(%rbx), %rbp
movq (%rbp,%r12,8), %rax
movq 0x8(%rax), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x26300
testl %eax, %eax
je 0x48215
movq %r14, %rdi
movq %r13, %rsi
callq 0x26300
testl %eax, %eax
je 0x48240
movq %r14, %rdi
leaq 0x7c618(%rip), %rsi     # 0xc47be
callq 0x26300
testl %eax, %eax
je 0x48270
movq %r14, %rdi
leaq 0x8beb8(%rip), %rsi     # 0xd4075
callq 0x26300
testl %eax, %eax
je 0x4837a
movq %r14, %rdi
leaq 0x7c5ef(%rip), %rsi     # 0xc47c3
callq 0x26300
testl %eax, %eax
jne 0x483dc
leaq 0xbe670(%rip), %rax     # 0x106858
cmpq $0x0, 0x818(%rax)
je 0x4834a
leaq 0xbe65b(%rip), %rax     # 0x106858
cmpq $0x0, 0x828(%rax)
je 0x4834a
callq 0x4848c
jmp 0x4834a
movq 0x8(%rbp,%r12,8), %rsi
movq %rbx, %rdi
leaq 0x8(%rsp), %rdx
xorl %ecx, %ecx
callq 0x44ba1
testl %eax, %eax
jne 0x4836b
movl 0x8(%rsp), %eax
movl %eax, 0x114(%rbx)
jmp 0x4834a
movq 0x8(%rbp,%r12,8), %rax
movq 0x8(%rax), %rsi
movzbl -0x1(%rsi), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x482b3
leaq 0x7be66(%rip), %rdi     # 0xc40c4
movslq (%rdi,%rax,4), %rcx
addq %rdi, %rcx
jmpq *%rcx
movl %edx, %r14d
shrl $0x3, %r14d
jmp 0x482b6
movq 0x8(%rbp,%r12,8), %rax
movq 0x8(%rax), %rdi
leaq 0x775d5(%rip), %rsi     # 0xbf855
callq 0x26300
testl %eax, %eax
jne 0x4834a
orb $0x1, 0x148(%rbx)
jmp 0x4834a
movq -0x11(%rsi), %r14
jmp 0x482b6
movzwl -0x5(%rsi), %r14d
jmp 0x482b6
movl -0x9(%rsi), %r14d
jmp 0x482b6
movzbl -0x3(%rsi), %r14d
jmp 0x482b6
xorl %r14d, %r14d
movl %eax, %ecx
cmpq $0x2d, %r14
ja 0x482d8
cmpl $0x4, %eax
ja 0x48320
leaq 0x7be22(%rip), %rdi     # 0xc40ec
movslq (%rdi,%rcx,4), %rax
addq %rdi, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x48322
cmpl $0x4, %eax
ja 0x48331
leaq 0x7bdf4(%rip), %rdi     # 0xc40d8
movslq (%rdi,%rcx,4), %rax
addq %rdi, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x48333
movq -0x11(%rsi), %rdx
jmp 0x48322
movq -0x11(%rsi), %rdx
jmp 0x48333
movzwl -0x5(%rsi), %edx
jmp 0x48322
movzwl -0x5(%rsi), %edx
jmp 0x48333
movl -0x9(%rsi), %edx
jmp 0x48322
movl -0x9(%rsi), %edx
jmp 0x48333
movzbl -0x3(%rsi), %edx
jmp 0x48322
movzbl -0x3(%rsi), %edx
jmp 0x48333
xorl %edx, %edx
incq %rdx
movq 0x10(%rsp), %rdi
callq 0x26c60
jmp 0x48344
xorl %edx, %edx
movq %rbx, %rdi
leaq 0x7c43b(%rip), %rsi     # 0xc4778
xorl %eax, %eax
callq 0x3fff2
cmpq $0x2e, %r14
jae 0x4836b
addq $0x2, %r12
cmpl %r12d, 0x38(%rbx)
jg 0x48169
leaq 0xbef51(%rip), %rax     # 0x1072b0
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x3fc19
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testb $0x1, 0x98(%rbx)
je 0x4836b
movq 0x8(%rbp,%r12,8), %rdi
leaq 0x8(%rsp), %rsi
callq 0x44a53
testl %eax, %eax
jne 0x4836b
movq 0x8(%rsp), %rax
cmpq 0xd0(%rbx), %rax
jle 0x483ab
movq %rax, 0xd0(%rbx)
leaq 0xbe4a6(%rip), %rax     # 0x106858
movq 0x968(%rax), %rax
movq %rax, 0xd8(%rbx)
cmpl $0x0, 0xa4(%rbx)
je 0x4836b
cmpl $0x9, 0xa0(%rbx)
jne 0x4836b
movq %rbx, %rdi
callq 0x483f5
jmp 0x4836b
leaq 0x7c3e7(%rip), %rsi     # 0xc47ca
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x3fff2
jmp 0x4836b