// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/replication.c
// Function: sendSynchronousCommand
char *sendSynchronousCommand(int flags, int fd, ...) {

    /* Create the command to send to the master, we use simple inline
     * protocol for simplicity as currently we only send simple strings. */
    if (flags & SYNC_CMD_WRITE) {
        char *arg;
        va_list ap;
        sds cmd = sdsempty();
        va_start(ap,fd);

        while(1) {
            arg = va_arg(ap, char*);
            if (arg == NULL) break;

            if (sdslen(cmd) != 0) cmd = sdscatlen(cmd," ",1);
            cmd = sdscat(cmd,arg);
        }
        cmd = sdscatlen(cmd,"\r\n",2);

        /* Transfer command to the server. */
        if (syncWrite(fd,cmd,sdslen(cmd),server.repl_syncio_timeout*1000)
            == -1)
        {
            sdsfree(cmd);
            return sdscatprintf(sdsempty(),"-Writing to master: %s",
                    strerror(errno));
        }
        sdsfree(cmd);
        va_end(ap);
    }

    /* Read the reply from the server. */
    if (flags & SYNC_CMD_READ) {
        char buf[256];

        if (syncReadLine(fd,buf,sizeof(buf),server.repl_syncio_timeout*1000)
            == -1)
        {
            return sdscatprintf(sdsempty(),"-Reading from master: %s",
                    strerror(errno));
        }
        server.repl_transfer_lastio = server.unixtime;
        return sdsnew(buf);
    }
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movl %esi, %ebx
movl %edi, %ebp
movq %rdx, 0x110(%rsp)
movq %rcx, 0x118(%rsp)
movq %r8, 0x120(%rsp)
movq %r9, 0x128(%rsp)
testb %al, %al
je 0x45d7b
movaps %xmm0, 0x130(%rsp)
movaps %xmm1, 0x140(%rsp)
movaps %xmm2, 0x150(%rsp)
movaps %xmm3, 0x160(%rsp)
movaps %xmm4, 0x170(%rsp)
movaps %xmm5, 0x180(%rsp)
movaps %xmm6, 0x190(%rsp)
movaps %xmm7, 0x1a0(%rsp)
testb $0x2, %bpl
je 0x45ecb
callq 0x3628d
movabsq $0x3000000010, %rcx     # imm = 0x3000000010
movq %rcx, (%rsp)
leaq 0x1e0(%rsp), %rcx
movq %rcx, 0x8(%rsp)
leaq 0x100(%rsp), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x7b3d3(%rip), %r12     # 0xc118c
leaq 0x7eedd(%rip), %r14     # 0xc4c9d
movl (%rsp), %edx
cmpq $0x28, %rdx
ja 0x45dd9
movq %rdx, %rcx
addq 0x10(%rsp), %rcx
addl $0x8, %edx
movl %edx, (%rsp)
jmp 0x45de7
movq 0x8(%rsp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsp)
movq (%rcx), %r15
testq %r15, %r15
je 0x45e45
movzbl -0x1(%rax), %ecx
movl %ecx, %edx
andl $0x7, %edx
cmpl $0x4, %edx
ja 0x45e35
movslq (%r12,%rdx,4), %rdx
addq %r12, %rdx
jmpq *%rdx
shrl $0x3, %ecx
jmp 0x45e20
movq -0x11(%rax), %rcx
jmp 0x45e20
movzwl -0x5(%rax), %ecx
jmp 0x45e20
movl -0x9(%rax), %ecx
jmp 0x45e20
movzbl -0x3(%rax), %ecx
testq %rcx, %rcx
je 0x45e35
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x36ad1
movq %rax, %rdi
movq %r15, %rsi
callq 0x36b9c
jmp 0x45dc0
leaq 0x7df90(%rip), %rsi     # 0xc3ddc
movl $0x2, %edx
movq %rax, %rdi
callq 0x36ad1
movq %rax, %r14
movzbl -0x1(%rax), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x45e99
leaq 0x7b32f(%rip), %rcx     # 0xc11a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x45e9b
movq -0x11(%r14), %rdx
jmp 0x45e9b
movzwl -0x5(%r14), %edx
jmp 0x45e9b
movl -0x9(%r14), %edx
jmp 0x45e9b
movzbl -0x3(%r14), %edx
jmp 0x45e9b
xorl %edx, %edx
leaq 0xbba06(%rip), %rax     # 0x1018a8
movslq 0x848(%rax), %rax
imulq $0x3e8, %rax, %rcx      # imm = 0x3E8
movl %ebx, %edi
movq %r14, %rsi
callq 0x64e6c
movq %rax, %r15
movq %r14, %rdi
callq 0x36330
cmpq $-0x1, %r15
je 0x45f1a
testb $0x1, %bpl
jne 0x45ed8
xorl %eax, %eax
jmp 0x45f5f
leaq 0xbb9c9(%rip), %r14     # 0x1018a8
movslq 0x848(%r14), %rax
imulq $0x3e8, %rax, %rcx      # imm = 0x3E8
movq %rsp, %rsi
movl $0x100, %edx            # imm = 0x100
movl %ebx, %edi
callq 0x64fcb
cmpq $-0x1, %rax
je 0x45f37
movq 0x978(%r14), %rax
movq %rax, 0x878(%r14)
movq %rsp, %rdi
callq 0x362b0
jmp 0x45f5f
callq 0x3628d
movq %rax, %rbx
callq 0x26880
movl (%rax), %edi
callq 0x26680
leaq 0x7bf1a(%rip), %rsi     # 0xc1e4f
jmp 0x45f52
callq 0x3628d
movq %rax, %rbx
callq 0x26880
movl (%rax), %edi
callq 0x26680
leaq 0x7bf14(%rip), %rsi     # 0xc1e66
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x36f2d
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq