// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
testb %al, %al
je 0x50307
movaps %xmm0, -0x1c0(%rbp)
movaps %xmm1, -0x1b0(%rbp)
movaps %xmm2, -0x1a0(%rbp)
movaps %xmm3, -0x190(%rbp)
movaps %xmm4, -0x180(%rbp)
movaps %xmm5, -0x170(%rbp)
movaps %xmm6, -0x160(%rbp)
movaps %xmm7, -0x150(%rbp)
movq %r9, -0x1c8(%rbp)
movq %r8, -0x1d0(%rbp)
movq %rcx, -0x1d8(%rbp)
movq %rdx, -0x1e0(%rbp)
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movl -0xc(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x504c6
callq 0x384f0
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rax
leaq -0x1f0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
leaq -0x30(%rbp), %rax
movq %rax, -0x200(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x1f4(%rbp)
cmpl $0x28, %eax
ja 0x503a0
movq -0x200(%rbp), %rcx
movl -0x1f4(%rbp), %edx
movslq %edx, %rax
addq 0x10(%rcx), %rax
addl $0x8, %edx
movl %edx, (%rcx)
movq %rax, -0x208(%rbp)
jmp 0x503bd
movq -0x200(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq %rax, -0x208(%rbp)
movq -0x208(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x503d4
jmp 0x50412
movq -0x38(%rbp), %rdi
callq 0x4dc30
cmpq $0x0, %rax
je 0x503fc
movq -0x38(%rbp), %rdi
leaq 0xeed5b(%rip), %rsi     # 0x13f149
movl $0x1, %edx
callq 0x39040
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x390d0
movq %rax, -0x38(%rbp)
jmp 0x50365
movq -0x38(%rbp), %rdi
leaq 0xede6b(%rip), %rsi     # 0x13e288
movl $0x2, %edx
callq 0x39040
movq %rax, -0x38(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x214(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x210(%rbp)
movq -0x38(%rbp), %rdi
callq 0x4dc30
movl -0x214(%rbp), %edi
movq -0x210(%rbp), %rsi
movq %rax, %rdx
leaq 0x127d79(%rip), %rax    # 0x1781d8
imull $0x3e8, 0x848(%rax), %eax # imm = 0x3E8
movslq %eax, %rcx
callq 0x7bae0
cmpq $-0x1, %rax
jne 0x504b9
movq -0x38(%rbp), %rdi
callq 0x38620
callq 0x384f0
movq %rax, -0x220(%rbp)
callq 0x26880
movl (%rax), %edi
callq 0x26690
movq -0x220(%rbp), %rdi
movq %rax, %rdx
leaq 0xec272(%rip), %rsi     # 0x13c71b
movb $0x0, %al
callq 0x395b0
movq %rax, -0x8(%rbp)
jmp 0x5056f
movq -0x38(%rbp), %rdi
callq 0x38620
leaq -0x30(%rbp), %rax
movl -0xc(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x50567
movl -0x10(%rbp), %edi
leaq -0x140(%rbp), %rsi
leaq 0x127cf2(%rip), %rax    # 0x1781d8
imull $0x3e8, 0x848(%rax), %eax # imm = 0x3E8
movslq %eax, %rcx
movl $0x100, %edx            # imm = 0x100
callq 0x7bd40
cmpq $-0x1, %rax
jne 0x50539
callq 0x384f0
movq %rax, -0x228(%rbp)
callq 0x26880
movl (%rax), %edi
callq 0x26690
movq -0x228(%rbp), %rdi
movq %rax, %rdx
leaq 0xec206(%rip), %rsi     # 0x13c732
movb $0x0, %al
callq 0x395b0
movq %rax, -0x8(%rbp)
jmp 0x5056f
leaq 0x127c98(%rip), %rax    # 0x1781d8
movq 0x978(%rax), %rcx
leaq 0x127c8a(%rip), %rax    # 0x1781d8
movq %rcx, 0x878(%rax)
leaq -0x140(%rbp), %rdi
callq 0x38510
movq %rax, -0x8(%rbp)
jmp 0x5056f
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopl (%rax)