LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/config.c
// Function: rewriteConfigGetContentFromState
sds rewriteConfigGetContentFromState(struct rewriteConfigState *state) {
    sds content = sdsempty();
    int j, was_empty = 0;

    for (j = 0; j < state->numlines; j++) {
        /* Every cluster of empty lines is turned into a single empty line. */
        if (sdslen(state->lines[j]) == 0) {
            if (was_empty) continue;
            was_empty = 1;
        } else {
            was_empty = 0;
        }
        content = sdscatsds(content,state->lines[j]);
        content = sdscatlen(content,"\n",1);
    }
    return content;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x3628d
movl 0x10(%rbx), %ecx
testl %ecx, %ecx
jle 0x5c1a8
xorl %r15d, %r15d
leaq 0x62d9f(%rip), %r14     # 0xbeec9
leaq 0x67bcf(%rip), %r12     # 0xc3d00
xorl %edx, %edx
movq 0x18(%rbx), %rsi
movq (%rsi,%r15,8), %rsi
movzbl -0x1(%rsi), %edi
movl %edi, %r8d
andl $0x7, %r8d
cmpl $0x4, %r8d
ja 0x5c177
movslq (%r12,%r8,4), %r8
addq %r12, %r8
jmpq *%r8
shrl $0x3, %edi
jmp 0x5c170
movq -0x11(%rsi), %rdi
jmp 0x5c170
movzwl -0x5(%rsi), %edi
jmp 0x5c170
movl -0x9(%rsi), %edi
jmp 0x5c170
movzbl -0x3(%rsi), %edi
xorl %ebp, %ebp
testq %rdi, %rdi
jne 0x5c180
movl $0x1, %ebp
testl %edx, %edx
jne 0x5c19b
movq %rax, %rdi
callq 0x36bc3
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x36ad1
movl 0x10(%rbx), %ecx
incq %r15
movslq %ecx, %rsi
movl %ebp, %edx
cmpq %rsi, %r15
jl 0x5c133
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/config.c
// Function: rewriteConfigReleaseState
void rewriteConfigReleaseState(struct rewriteConfigState *state) {
    sdsfreesplitres(state->lines,state->numlines);
    dictRelease(state->option_to_line);
    dictRelease(state->rewritten);
    zfree(state);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movl 0x10(%rbx), %esi
callq 0x37c04
movq (%rbx), %rdi
callq 0x2eef3
movq 0x8(%rbx), %rdi
callq 0x2eef3
movq %rbx, %rdi
popq %rbx
jmp 0x38413
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/config.c
// Function: rewriteConfigRemoveOrphaned
void rewriteConfigRemoveOrphaned(struct rewriteConfigState *state) {
    dictIterator *di = dictGetIterator(state->option_to_line);
    dictEntry *de;

    while((de = dictNext(di)) != NULL) {
        list *l = dictGetVal(de);
        sds option = dictGetKey(de);

        /* Don't blank lines about options the rewrite process
         * don't understand. */
        if (dictFind(state->rewritten,option) == NULL) {
            serverLog(LL_DEBUG,"Not rewritten option: %s", option);
            continue;
        }

        while(listLength(l)) {
            listNode *ln = listFirst(l);
            int linenum = (long) ln->value;

            sdsfree(state->lines[linenum]);
            state->lines[linenum] = sdsempty();
            listDelNode(l,ln);
        }
    }
    dictReleaseIterator(di);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x2efbb
movq %rax, %r14
movq %rax, %rdi
callq 0x2f015
testq %rax, %rax
je 0x5c273
leaq 0x68afb(%rip), %r15     # 0xc4d03
movq (%rax), %r13
movq 0x8(%rax), %r12
movq 0x8(%rbx), %rdi
movq %r13, %rsi
callq 0x2ebca
testq %rax, %rax
jne 0x5c25e
xorl %edi, %edi
movq %r15, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x2fdad
jmp 0x5c266
movq (%r12), %r13
movslq 0x10(%r13), %rbp
movq 0x18(%rbx), %rax
movq (%rax,%rbp,8), %rdi
callq 0x36330
callq 0x3628d
movq 0x18(%rbx), %rcx
movq %rax, (%rcx,%rbp,8)
movq %r12, %rdi
movq %r13, %rsi
callq 0x2b331
cmpq $0x0, 0x28(%r12)
jne 0x5c231
movq %r14, %rdi
callq 0x2f015
testq %rax, %rax
jne 0x5c208
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2f0dd
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/config.c
// Function: rewriteConfigOverwriteFile
int rewriteConfigOverwriteFile(char *configfile, sds content) {
    int retval = 0;
    int fd = open(configfile,O_RDWR|O_CREAT,0644);
    int content_size = sdslen(content), padding = 0;
    struct stat sb;
    sds content_padded;

    /* 1) Open the old file (or create a new one if it does not
     *    exist), get the size. */
    if (fd == -1) return -1; /* errno set by open(). */
    if (fstat(fd,&sb) == -1) {
        close(fd);
        return -1; /* errno set by fstat(). */
    }

    /* 2) Pad the content at least match the old file size. */
    content_padded = sdsdup(content);
    if (content_size < sb.st_size) {
        /* If the old file was bigger, pad the content with
         * a newline plus as many "#" chars as required. */
        padding = sb.st_size - content_size;
        content_padded = sdsgrowzero(content_padded,sb.st_size);
        content_padded[content_size] = '\n';
        memset(content_padded+content_size+1,'#',padding-1);
    }

    /* 3) Write the new content using a single write(2). */
    if (write(fd,content_padded,strlen(content_padded)) == -1) {
        retval = -1;
        goto cleanup;
    }

    /* 4) Truncate the file to the right length if we used padding. */
    if (padding) {
        if (ftruncate(fd,content_size) == -1) {
            /* Non critical error... */
        }
    }

cleanup:
    sdsfree(content_padded);
    close(fd);
    return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %r14
xorl %r12d, %r12d
movl $0x42, %esi
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x26690
movl %eax, %ebx
movzbl -0x1(%r14), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x5c2f2
leaq 0x67a4b(%rip), %rdx     # 0xc3d14
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
shrl $0x3, %eax
movq %rax, %r12
jmp 0x5c2f2
movq -0x11(%r14), %r12
jmp 0x5c2f2
movzwl -0x5(%r14), %r12d
jmp 0x5c2f2
movl -0x9(%r14), %r12d
jmp 0x5c2f2
movzbl -0x3(%r14), %r12d
cmpl $-0x1, %ebx
je 0x5c3a1
leaq 0x8(%rsp), %rsi
movl %ebx, %edi
callq 0x266e0
cmpl $-0x1, %eax
je 0x5c3a8
movq %r14, %rdi
callq 0x362e0
movq %rax, %r14
movslq %r12d, %r15
movq 0x38(%rsp), %rsi
movb $0x1, %r13b
cmpq %rsi, %r15
jge 0x5c35f
movl %esi, %r13d
subl %r12d, %r13d
movq %r14, %rdi
callq 0x36a02
movq %rax, %r14
leaq (%rax,%r15), %rdi
incq %rdi
movb $0xa, -0x1(%rdi)
leal -0x1(%r13), %eax
movslq %eax, %rdx
movl $0x23, %esi
callq 0x26110
testl %r13d, %r13d
sete %r13b
movq %r14, %rdi
callq 0x26500
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x26bb0
xorl %ebp, %ebp
cmpq $-0x1, %rax
sete %bpl
negl %ebp
cmpq $-0x1, %rax
je 0x5c397
testb %r13b, %r13b
jne 0x5c397
movl %ebx, %edi
movq %r15, %rsi
callq 0x26730
xorl %ebp, %ebp
movq %r14, %rdi
callq 0x36330
jmp 0x5c3ad
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x5c3b4
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebx, %edi
callq 0x26180
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/aof.c
// Function: aofRewriteBufferReset
void aofRewriteBufferReset(void) {
    if (server.aof_rewrite_buf_blocks)
        listRelease(server.aof_rewrite_buf_blocks);

    server.aof_rewrite_buf_blocks = listCreate();
    listSetFreeMethod(server.aof_rewrite_buf_blocks,zfree);
}

// Assembly:
pushq %rbx
leaq 0xa4bac(%rip), %rbx     # 0x1018a8
movq 0x6a0(%rbx), %rdi
testq %rdi, %rdi
je 0x5cd0d
callq 0x2b19c
callq 0x2b17c
movq %rax, 0x6a0(%rbx)
leaq -0x2490d(%rip), %rcx    # 0x38413
movq %rcx, 0x18(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/aof.c
// Function: aofRewriteBufferSize
unsigned long aofRewriteBufferSize(void) {
    listNode *ln;
    listIter li;
    unsigned long size = 0;

    listRewind(server.aof_rewrite_buf_blocks,&li);
    while((ln = listNext(&li))) {
        aofrwblock *block = listNodeValue(ln);
        size += block->used;
    }
    return size;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0xa4b74(%rip), %rax     # 0x1018a8
movq 0x6a0(%rax), %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x2b3b7
movq %rbx, %rdi
callq 0x2b3d4
xorl %ebx, %ebx
testq %rax, %rax
je 0x5cd70
leaq 0x8(%rsp), %r14
movq 0x10(%rax), %rax
addq (%rax), %rbx
movq %r14, %rdi
callq 0x2b3d4
testq %rax, %rax
jne 0x5cd5c
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/aof.c
// Function: aofChildWriteDiffData
void aofChildWriteDiffData(aeEventLoop *el, int fd, void *privdata, int mask) {
    listNode *ln;
    aofrwblock *block;
    ssize_t nwritten;
    UNUSED(el);
    UNUSED(fd);
    UNUSED(privdata);
    UNUSED(mask);

    while(1) {
        ln = listFirst(server.aof_rewrite_buf_blocks);
        block = ln ? ln->value : NULL;
        if (server.aof_stop_sending_diff || !block) {
            aeDeleteFileEvent(server.el,server.aof_pipe_write_data_to_child,
                              AE_WRITABLE);
            return;
        }
        if (block->used > 0) {
            nwritten = write(server.aof_pipe_write_data_to_child,
                             block->buf,block->used);
            if (nwritten <= 0) return;
            memmove(block->buf,block->buf+nwritten,block->used-nwritten);
            block->used -= nwritten;
            block->free += nwritten;
        }
        if (block->used == 0) listDelNode(server.aof_rewrite_buf_blocks,ln);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xa4b1b(%rip), %r12     # 0x1018a8
movq 0x6a0(%r12), %rdi
movq (%rdi), %rbx
testq %rbx, %rbx
je 0x5ce0b
cmpl $0x0, 0x710(%r12)
jne 0x5ce0b
movq 0x10(%rbx), %r13
testq %r13, %r13
je 0x5ce0b
movq (%r13), %rdx
testq %rdx, %rdx
je 0x5ce01
movl 0x6f8(%r12), %edi
leaq 0x10(%r13), %r14
movq %r14, %rsi
callq 0x26bb0
testq %rax, %rax
jle 0x5ce30
movq %rax, %r15
leaq (%r14,%rax), %rsi
movq (%r13), %rbp
movq %rbp, %rdx
subq %rax, %rdx
movq %r14, %rdi
callq 0x267e0
addq %r15, 0x8(%r13)
subq %r15, %rbp
movq %rbp, (%r13)
jne 0x5cd8d
movq 0x6a0(%r12), %rdi
movq %rbx, %rsi
callq 0x2b331
jmp 0x5cd8d
movq 0x40(%r12), %rdi
movl 0x6f8(%r12), %esi
movl $0x2, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2cf0e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/aof.c
// Function: aofRewriteBufferWrite
ssize_t aofRewriteBufferWrite(int fd) {
    listNode *ln;
    listIter li;
    ssize_t count = 0;

    listRewind(server.aof_rewrite_buf_blocks,&li);
    while((ln = listNext(&li))) {
        aofrwblock *block = listNodeValue(ln);
        ssize_t nwritten;

        if (block->used) {
            nwritten = write(fd,block->buf,block->used);
            if (nwritten != (ssize_t)block->used) {
                if (nwritten == 0) errno = EIO;
                return -1;
            }
            count += nwritten;
        }
    }
    return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edi, %ebp
leaq 0xa48fd(%rip), %rax     # 0x1018a8
movq 0x6a0(%rax), %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x2b3b7
movq %rbx, %rdi
callq 0x2b3d4
xorl %ebx, %ebx
testq %rax, %rax
je 0x5d018
leaq 0x8(%rsp), %r14
movq 0x10(%rax), %r15
movq (%r15), %rdx
testq %rdx, %rdx
je 0x5cff2
leaq 0x10(%r15), %rsi
movl %ebp, %edi
callq 0x26bb0
cmpq (%r15), %rax
jne 0x5d001
addq %rax, %rbx
movq %r14, %rdi
callq 0x2b3d4
testq %rax, %rax
jne 0x5cfd3
jmp 0x5d018
movq $-0x1, %rbx
testq %rax, %rax
jne 0x5d018
callq 0x26880
movl $0x5, (%rax)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/aof.c
// Function: stopAppendOnly
void stopAppendOnly(void) {
    serverAssert(server.aof_state != AOF_OFF);
    flushAppendOnlyFile(1);
    aof_fsync(server.aof_fd);
    close(server.aof_fd);

    server.aof_fd = -1;
    server.aof_selected_db = -1;
    server.aof_state = AOF_OFF;
    /* rewrite operation in progress? kill it, wait child exit */
    if (server.aof_child_pid != -1) {
        int statloc;

        serverLog(LL_NOTICE,"Killing running AOF rewrite child: %ld",
            (long) server.aof_child_pid);
        if (kill(server.aof_child_pid,SIGUSR1) != -1) {
            while(wait3(&statloc,0,NULL) != server.aof_child_pid);
        }
        /* reset the buffer accumulating changes while the child saves */
        aofRewriteBufferReset();
        aofRemoveTempFile(server.aof_child_pid);
        server.aof_child_pid = -1;
        server.aof_rewrite_time_start = -1;
        /* close pipes used for IPC between the two processes. */
        aofClosePipes();
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
leaq 0xa4860(%rip), %r14     # 0x1018a8
cmpl $0x0, 0x668(%r14)
je 0x5d137
movl $0x1, %edi
callq 0x5d159
movl 0x6b0(%r14), %edi
callq 0x26570
movl 0x6b0(%r14), %edi
callq 0x26180
movq $-0x1, 0x6b0(%r14)
movl $0x0, 0x668(%r14)
movslq 0x69c(%r14), %rdx
cmpq $-0x1, %rdx
je 0x5d12c
leaq 0x67edb(%rip), %rsi     # 0xc4f81
movl $0x2, %edi
xorl %eax, %eax
callq 0x2fdad
movl 0x69c(%r14), %edi
movl $0xa, %esi
callq 0x26660
cmpl $-0x1, %eax
je 0x5d0e2
leaq 0xc(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x26870
cmpl 0x69c(%r14), %eax
jne 0x5d0cd
callq 0x5ccf4
movl 0x69c(%r14), %ecx
leaq 0x688b8(%rip), %rdx     # 0xc59ad
leaq 0x10(%rsp), %rbx
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdi
xorl %eax, %eax
callq 0x26120
movq %rbx, %rdi
callq 0x263b0
movl $0xffffffff, 0x69c(%r14) # imm = 0xFFFFFFFF
movq $-0x1, 0x6d0(%r14)
callq 0x5d713
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r14
retq
leaq 0x67e21(%rip), %rdi     # 0xc4f5f
leaq 0x67e36(%rip), %rsi     # 0xc4f7b
movl $0xd1, %edx
callq 0x61908
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/aof.c
// Function: aofClosePipes
void aofClosePipes(void) {
    aeDeleteFileEvent(server.el,server.aof_pipe_read_ack_from_child,AE_READABLE);
    aeDeleteFileEvent(server.el,server.aof_pipe_write_data_to_child,AE_WRITABLE);
    close(server.aof_pipe_write_data_to_child);
    close(server.aof_pipe_read_data_from_parent);
    close(server.aof_pipe_write_ack_to_parent);
    close(server.aof_pipe_read_ack_from_child);
    close(server.aof_pipe_write_ack_to_child);
    close(server.aof_pipe_read_ack_from_parent);
}

// Assembly:
pushq %rbx
leaq 0xa418d(%rip), %rbx     # 0x1018a8
movq 0x40(%rbx), %rdi
movl 0x704(%rbx), %esi
movl $0x1, %edx
callq 0x2cf0e
movq 0x40(%rbx), %rdi
movl 0x6f8(%rbx), %esi
movl $0x2, %edx
callq 0x2cf0e
movl 0x6f8(%rbx), %edi
callq 0x26180
movl 0x6fc(%rbx), %edi
callq 0x26180
movl 0x700(%rbx), %edi
callq 0x26180
movl 0x704(%rbx), %edi
callq 0x26180
movl 0x708(%rbx), %edi
callq 0x26180
movl 0x70c(%rbx), %edi
popq %rbx
jmp 0x26180
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/aof.c
// Function: startAppendOnly
int startAppendOnly(void) {
    char cwd[MAXPATHLEN]; /* Current working dir path for error messages. */

    server.aof_last_fsync = server.unixtime;
    server.aof_fd = open(server.aof_filename,O_WRONLY|O_APPEND|O_CREAT,0644);
    serverAssert(server.aof_state == AOF_OFF);
    if (server.aof_fd == -1) {
        char *cwdp = getcwd(cwd,MAXPATHLEN);

        serverLog(LL_WARNING,
            "Redis needs to enable the AOF but can't open the "
            "append only file %s (in server root dir %s): %s",
            server.aof_filename,
            cwdp ? cwdp : "unknown",
            strerror(errno));
        return C_ERR;
    }
    if (server.rdb_child_pid != -1) {
        server.aof_rewrite_scheduled = 1;
        serverLog(LL_WARNING,"AOF was enabled but there is already a child process saving an RDB file on disk. An AOF background was scheduled to start when possible.");
    } else if (rewriteAppendOnlyFileBackground() == C_ERR) {
        close(server.aof_fd);
        serverLog(LL_WARNING,"Redis needs to enable the AOF but can't trigger a background AOF rewrite operation. Check the above logs for more info about the error.");
        return C_ERR;
    }
    /* We correctly switched on AOF, now wait for the rewrite to be complete
     * in order to append data on disk. */
    server.aof_state = AOF_WAIT_REWRITE;
    return C_OK;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
leaq 0xa4111(%rip), %rbx     # 0x1018a8
movq 0x978(%rbx), %rax
movq %rax, 0x6c0(%rbx)
movq 0x670(%rbx), %rdi
movl $0x441, %esi            # imm = 0x441
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x26690
movl %eax, 0x6b0(%rbx)
cmpl $0x0, 0x668(%rbx)
jne 0x5d88f
cmpl $-0x1, %eax
je 0x5d7fd
cmpl $-0x1, 0x730(%rbx)
je 0x5d84e
movl $0x1, 0x698(%rbx)
leaq 0x67836(%rip), %rsi     # 0xc5025
movl $0x3, %edi
xorl %eax, %eax
callq 0x2fdad
jmp 0x5d858
movq %rsp, %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x26910
movq 0x670(%rbx), %rbx
testq %rax, %rax
leaq 0x635c8(%rip), %r14     # 0xc0de3
cmovneq %rax, %r14
callq 0x26880
movl (%rax), %edi
callq 0x26680
leaq 0x67792(%rip), %rsi     # 0xc4fc4
movl $0x3, %edi
movq %rbx, %rdx
movq %r14, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x2fdad
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x5d864
callq 0x5d8b1
cmpl $-0x1, %eax
je 0x5d86f
movl $0x2, 0x668(%rbx)
xorl %eax, %eax
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r14
retq
movl 0x6b0(%rbx), %edi
callq 0x26180
leaq 0x6782d(%rip), %rsi     # 0xc50ae
movl $0x3, %edi
xorl %eax, %eax
callq 0x2fdad
jmp 0x5d847
leaq 0x67712(%rip), %rdi     # 0xc4fa8
leaq 0x676de(%rip), %rsi     # 0xc4f7b
movl $0xf3, %edx
callq 0x61908
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/aof.c
// Function: catAppendOnlyGenericCommand
sds catAppendOnlyGenericCommand(sds dst, int argc, robj **argv) {
    char buf[32];
    int len, j;
    robj *o;

    buf[0] = '*';
    len = 1+ll2string(buf+1,sizeof(buf)-1,argc);
    buf[len++] = '\r';
    buf[len++] = '\n';
    dst = sdscatlen(dst,buf,len);

    for (j = 0; j < argc; j++) {
        o = getDecodedObject(argv[j]);
        buf[0] = '$';
        len = 1+ll2string(buf+1,sizeof(buf)-1,sdslen(o->ptr));
        buf[len++] = '\r';
        buf[len++] = '\n';
        dst = sdscatlen(dst,buf,len);
        dst = sdscatlen(dst,o->ptr,sdslen(o->ptr));
        dst = sdscatlen(dst,"\r\n",2);
        decrRefCount(o);
    }
    return dst;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movl %esi, %r12d
movq %rdi, %rbp
leaq 0x1(%rsp), %rdi
movb $0x2a, -0x1(%rdi)
movslq %esi, %r13
movl $0x1f, %esi
movq %r13, %rdx
callq 0x3ff83
cltq
movq %rsp, %r15
movw $0xa0d, 0x1(%rax,%r15)  # imm = 0xA0D
addl $0x3, %eax
movslq %eax, %rdx
movq %rbp, %rdi
movq %r15, %rsi
callq 0x36ad1
movq %rax, %rbp
testl %r13d, %r13d
jle 0x5dc31
movl %r12d, %r14d
xorl %r12d, %r12d
movq (%rbx,%r12,8), %rdi
callq 0x41026
movq %rax, %r13
movb $0x24, (%rsp)
movq 0x8(%rax), %rax
movzbl -0x1(%rax), %edx
movl %edx, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x5db92
leaq 0x67357(%rip), %rsi     # 0xc4ec4
movslq (%rsi,%rcx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
shrl $0x3, %edx
jmp 0x5db94
movq -0x11(%rax), %rdx
jmp 0x5db94
movzwl -0x5(%rax), %edx
jmp 0x5db94
movl -0x9(%rax), %edx
jmp 0x5db94
movzbl -0x3(%rax), %edx
jmp 0x5db94
xorl %edx, %edx
movl $0x1f, %esi
leaq 0x1(%rsp), %rdi
callq 0x3ff83
cltq
movw $0xa0d, 0x1(%rax,%r15)  # imm = 0xA0D
addl $0x3, %eax
movslq %eax, %rdx
movq %rbp, %rdi
movq %r15, %rsi
callq 0x36ad1
movq 0x8(%r13), %rsi
movzbl -0x1(%rsi), %edx
movl %edx, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x5dbfc
leaq 0x67301(%rip), %rdi     # 0xc4ed8
movslq (%rdi,%rcx,4), %rcx
addq %rdi, %rcx
jmpq *%rcx
shrl $0x3, %edx
jmp 0x5dbfe
movq -0x11(%rsi), %rdx
jmp 0x5dbfe
movzwl -0x5(%rsi), %edx
jmp 0x5dbfe
movl -0x9(%rsi), %edx
jmp 0x5dbfe
movzbl -0x3(%rsi), %edx
jmp 0x5dbfe
xorl %edx, %edx
movq %rax, %rdi
callq 0x36ad1
movl $0x2, %edx
movq %rax, %rdi
leaq 0x661c7(%rip), %rsi     # 0xc3ddc
callq 0x36ad1
movq %rax, %rbp
movq %r13, %rdi
callq 0x40c8f
incq %r12
cmpq %r12, %r14
jne 0x5db44
movq %rbp, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/aof.c
// Function: catAppendOnlyExpireAtCommand
sds catAppendOnlyExpireAtCommand(sds buf, struct redisCommand *cmd, robj *key, robj *seconds) {
    long long when;
    robj *argv[3];

    /* Make sure we can use strtoll */
    seconds = getDecodedObject(seconds);
    when = strtoll(seconds->ptr,NULL,10);
    /* Convert argument into milliseconds for EXPIRE, SETEX, EXPIREAT */
    if (cmd->proc == expireCommand || cmd->proc == setexCommand ||
        cmd->proc == expireatCommand)
    {
        when *= 1000;
    }
    /* Convert into absolute time for EXPIRE, PEXPIRE, SETEX, PSETEX */
    if (cmd->proc == expireCommand || cmd->proc == pexpireCommand ||
        cmd->proc == setexCommand || cmd->proc == psetexCommand)
    {
        when += mstime();
    }
    decrRefCount(seconds);

    argv[0] = createStringObject("PEXPIREAT",9);
    argv[1] = key;
    argv[2] = createStringObjectFromLongLong(when);
    buf = catAppendOnlyGenericCommand(buf, 3, argv);
    decrRefCount(argv[0]);
    decrRefCount(argv[2]);
    return buf;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %rbx
movq %rcx, %rdi
callq 0x41026
movq %rax, %r12
movq 0x8(%rax), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x26af0
movq %rax, %r15
movq 0x8(%r13), %rax
imulq $0x3e8, %r15, %rcx      # imm = 0x3E8
cmpq 0x9f347(%rip), %rax     # 0xfcfd0
leaq -0x1271b(%rip), %rdx    # 0x4b575
cmoveq %rcx, %r15
cmpq %rdx, %rax
cmoveq %rcx, %r15
cmpq 0x9f286(%rip), %rax     # 0xfcf28
cmoveq %rcx, %r15
cmpq %rdx, %rax
je 0x5dcc6
cmpq 0x9f276(%rip), %rax     # 0xfcf28
je 0x5dcc6
cmpq 0x9f2f5(%rip), %rax     # 0xfcfb0
je 0x5dcc6
cmpq 0x9f2c4(%rip), %rax     # 0xfcf88
jne 0x5dcce
callq 0x2ffce
addq %rax, %r15
movq %r12, %rdi
callq 0x40c8f
leaq 0x676be(%rip), %rdi     # 0xc539b
movl $0x9, %esi
callq 0x40744
movq %rax, %r12
movq %rsp, %r13
movq %rax, (%r13)
movq %r14, 0x8(%r13)
movq %r15, %rdi
callq 0x40753
movq %rax, %r14
movq %rax, 0x10(%r13)
movq %rbx, %rdi
movl $0x3, %esi
movq %r13, %rdx
callq 0x5dae4
movq %rax, %rbx
movq %r12, %rdi
callq 0x40c8f
movq %r14, %rdi
callq 0x40c8f
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/aof.c
// Function: createFakeClient
struct client *createFakeClient(void) {
    struct client *c = zmalloc(sizeof(*c));

    selectDb(c,0);
    c->fd = -1;
    c->name = NULL;
    c->querybuf = sdsempty();
    c->querybuf_peak = 0;
    c->argc = 0;
    c->argv = NULL;
    c->bufpos = 0;
    c->flags = 0;
    c->btype = BLOCKED_NONE;
    /* We set the fake client as a slave waiting for the synchronization
     * so that Redis will not try to send replies to this client. */
    c->replstate = SLAVE_STATE_WAIT_BGSAVE_START;
    c->reply = listCreate();
    c->reply_bytes = 0;
    c->obuf_soft_limit_reached_time = 0;
    c->watched_keys = listCreate();
    c->peerid = NULL;
    listSetFreeMethod(c->reply,decrRefCountVoid);
    listSetDupMethod(c->reply,dupClientReplyValue);
    initClientMultiState(c);
    return c;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x41c8, %edi           # imm = 0x41C8
callq 0x382d1
movq %rax, %rbx
xorl %r14d, %r14d
movq %rax, %rdi
xorl %esi, %esi
callq 0x420b7
movl $0xffffffff, 0x8(%rbx)  # imm = 0xFFFFFFFF
movq %r14, 0x20(%rbx)
callq 0x3628d
movq %rax, 0x28(%rbx)
movq %r14, 0x30(%rbx)
movl %r14d, 0x38(%rbx)
movq %r14, 0x40(%rbx)
movl %r14d, 0x1c0(%rbx)
movl %r14d, 0x98(%rbx)
movl %r14d, 0x168(%rbx)
movl $0x6, 0xa0(%rbx)
callq 0x2b17c
movq %rax, 0x68(%rbx)
movq %r14, 0x70(%rbx)
movq %r14, 0x90(%rbx)
callq 0x2b17c
movq %rax, 0x1a0(%rbx)
movq %r14, 0x1b8(%rbx)
movq 0x68(%rbx), %rax
leaq -0x1d398(%rip), %rcx    # 0x40d37
movq %rcx, 0x18(%rax)
leaq -0x22319(%rip), %rcx    # 0x3bdc1
movq %rcx, 0x10(%rax)
movq %rbx, %rdi
callq 0x60988
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/aof.c
// Function: freeFakeClientArgv
void freeFakeClientArgv(struct client *c) {
    int j;

    for (j = 0; j < c->argc; j++)
        decrRefCount(c->argv[j]);
    zfree(c->argv);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x38(%rdi)
jle 0x5e11a
xorl %r14d, %r14d
movq 0x40(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x40c8f
incq %r14
movslq 0x38(%rbx), %rax
cmpq %rax, %r14
jl 0x5e101
movq 0x40(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x38413
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/aof.c
// Function: freeFakeClient
void freeFakeClient(struct client *c) {
    sdsfree(c->querybuf);
    listRelease(c->reply);
    listRelease(c->watched_keys);
    freeClientMultiState(c);
    zfree(c);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
callq 0x36330
movq 0x68(%rbx), %rdi
callq 0x2b19c
movq 0x1a0(%rbx), %rdi
callq 0x2b19c
movq %rbx, %rdi
callq 0x6099e
movq %rbx, %rdi
popq %rbx
jmp 0x38413
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/aof.c
// Function: aofUpdateCurrentSize
void aofUpdateCurrentSize(void) {
    struct redis_stat sb;
    mstime_t latency;

    latencyStartMonitor(latency);
    if (redis_fstat(server.aof_fd,&sb) == -1) {
        serverLog(LL_WARNING,"Unable to obtain the AOF file length. stat: %s",
            strerror(errno));
    } else {
        server.aof_current_size = sb.st_size;
    }
    latencyEndMonitor(latency);
    latencyAddSampleIfNeeded("aof-fstat",latency);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x98, %rsp
leaq 0xa3218(%rip), %r14     # 0x1018a8
cmpq $0x0, 0xa18(%r14)
je 0x5e6a4
callq 0x2ffce
movq %rax, %rbx
jmp 0x5e6a6
xorl %ebx, %ebx
movl 0x6b0(%r14), %edi
leaq 0x8(%rsp), %rsi
callq 0x266e0
cmpl $-0x1, %eax
je 0x5e6ca
movq 0x38(%rsp), %rax
movq %rax, 0x690(%r14)
jmp 0x5e6ec
callq 0x26880
movl (%rax), %edi
callq 0x26680
leaq 0x67425(%rip), %rsi     # 0xc5b02
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2fdad
cmpq $0x0, 0xa18(%r14)
je 0x5e715
callq 0x2ffce
subq %rbx, %rax
movq 0xa18(%r14), %rcx
testq %rcx, %rcx
sete %dl
cmpq %rcx, %rax
setl %cl
orb %dl, %cl
je 0x5e720
addq $0x98, %rsp
popq %rbx
popq %r14
retq
leaq 0x6740a(%rip), %rdi     # 0xc5b31
movq %rax, %rsi
addq $0x98, %rsp
popq %rbx
popq %r14
jmp 0x7eb75
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/aof.c
// Function: rioWriteBulkObject
int rioWriteBulkObject(rio *r, robj *obj) {
    /* Avoid using getDecodedObject to help copy-on-write (we are often
     * in a child process when this function is called). */
    if (obj->encoding == OBJ_ENCODING_INT) {
        return rioWriteBulkLongLong(r,(long)obj->ptr);
    } else if (sdsEncodedObject(obj)) {
        return rioWriteBulkString(r,obj->ptr,sdslen(obj->ptr));
    } else {
        serverPanic("Unknown string encoding");
    }
}

// Assembly:
pushq %rax
movl (%rsi), %eax
shrl $0x4, %eax
andl $0xf, %eax
je 0x5e759
cmpl $0x8, %eax
je 0x5e759
cmpl $0x1, %eax
jne 0x5e7a0
movq 0x8(%rsi), %rsi
callq 0x7296b
jmp 0x5e79e
movq 0x8(%rsi), %rsi
movzbl -0x1(%rsi), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x5e797
leaq 0x667a2(%rip), %rcx     # 0xc4f14
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x5e799
movq -0x11(%rsi), %rdx
jmp 0x5e799
movzwl -0x5(%rsi), %edx
jmp 0x5e799
movl -0x9(%rsi), %edx
jmp 0x5e799
movzbl -0x3(%rsi), %edx
jmp 0x5e799
xorl %edx, %edx
callq 0x72874
popq %rcx
retq
leaq 0x625dc(%rip), %rdi     # 0xc0d83
leaq 0x667cd(%rip), %rsi     # 0xc4f7b
movl $0x31e, %edx            # imm = 0x31E
callq 0x619b4
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/aof.c
// Function: rewriteListObject
int rewriteListObject(rio *r, robj *key, robj *o) {
    long long count = 0, items = listTypeLength(o);

    if (o->encoding == OBJ_ENCODING_QUICKLIST) {
        quicklist *list = o->ptr;
        quicklistIter *li = quicklistGetIterator(list, AL_START_HEAD);
        quicklistEntry entry;

        while (quicklistNext(li,&entry)) {
            if (count == 0) {
                int cmd_items = (items > AOF_REWRITE_ITEMS_PER_CMD) ?
                    AOF_REWRITE_ITEMS_PER_CMD : items;
                if (rioWriteBulkCount(r,'*',2+cmd_items) == 0) return 0;
                if (rioWriteBulkString(r,"RPUSH",5) == 0) return 0;
                if (rioWriteBulkObject(r,key) == 0) return 0;
            }

            if (entry.value) {
                if (rioWriteBulkString(r,(char*)entry.value,entry.sz) == 0) return 0;
            } else {
                if (rioWriteBulkLongLong(r,entry.longval) == 0) return 0;
            }
            if (++count == AOF_REWRITE_ITEMS_PER_CMD) count = 0;
            items--;
        }
        quicklistReleaseIterator(li);
    } else {
        serverPanic("Unknown list encoding");
    }
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r12
movq %rsi, (%rsp)
movq %rdi, %r14
movq %rdx, %rdi
callq 0x4c4aa
movq %rax, %r15
movl $0xf0, %eax
andl (%r12), %eax
cmpl $0x90, %eax
jne 0x5e8f0
movq 0x8(%r12), %rdi
xorl %esi, %esi
callq 0x2c471
movq %rax, %r12
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x2c4fb
testl %eax, %eax
je 0x5e8cb
xorl %ebx, %ebx
leaq 0x8(%rsp), %rbp
xorl %r13d, %r13d
testq %rbx, %rbx
jne 0x5e87b
cmpq $0x40, %r15
movl $0x40, %edx
cmovlq %r15, %rdx
addl $0x2, %edx
movq %r14, %rdi
movl $0x2a, %esi
callq 0x727d4
testq %rax, %rax
je 0x5e8de
movl $0x5, %edx
movq %r14, %rdi
leaq 0x66ef8(%rip), %rsi     # 0xc5759
callq 0x72874
testq %rax, %rax
je 0x5e8de
movq %r14, %rdi
movq (%rsp), %rsi
callq 0x5e739
testl %eax, %eax
je 0x5e8de
movq 0x20(%rsp), %rsi
testq %rsi, %rsi
je 0x5e893
movl 0x30(%rsp), %edx
movq %r14, %rdi
callq 0x72874
jmp 0x5e8a0
movq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x7296b
testq %rax, %rax
je 0x5e8db
incq %rbx
cmpq $0x40, %rbx
movl $0x0, %eax
cmoveq %rax, %rbx
decq %r15
movq %r12, %rdi
movq %rbp, %rsi
callq 0x2c4fb
testl %eax, %eax
jne 0x5e827
movq %r12, %rdi
callq 0x2c4be
movl $0x1, %r13d
jmp 0x5e8de
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6415b(%rip), %rdi     # 0xc2a52
leaq 0x6667d(%rip), %rsi     # 0xc4f7b
movl $0x33f, %edx            # imm = 0x33F
callq 0x619b4
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/aof.c
// Function: rewriteHashObject
int rewriteHashObject(rio *r, robj *key, robj *o) {
    hashTypeIterator *hi;
    long long count = 0, items = hashTypeLength(o);

    hi = hashTypeInitIterator(o);
    while (hashTypeNext(hi) != C_ERR) {
        if (count == 0) {
            int cmd_items = (items > AOF_REWRITE_ITEMS_PER_CMD) ?
                AOF_REWRITE_ITEMS_PER_CMD : items;

            if (rioWriteBulkCount(r,'*',2+cmd_items*2) == 0) return 0;
            if (rioWriteBulkString(r,"HMSET",5) == 0) return 0;
            if (rioWriteBulkObject(r,key) == 0) return 0;
        }

        if (rioWriteHashIteratorCursor(r, hi, OBJ_HASH_KEY) == 0) return 0;
        if (rioWriteHashIteratorCursor(r, hi, OBJ_HASH_VALUE) == 0) return 0;
        if (++count == AOF_REWRITE_ITEMS_PER_CMD) count = 0;
        items--;
    }

    hashTypeReleaseIterator(hi);

    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
movq %rdx, %rdi
callq 0x55afa
movq %rax, %r15
movq %r12, %rdi
callq 0x55c77
movq %rax, %r12
movq %rax, %rdi
callq 0x55d03
cmpl $-0x1, %eax
je 0x5eed0
xorl %r13d, %r13d
testq %r13, %r13
jne 0x5ee82
cmpq $0x40, %r15
movl $0x40, %eax
cmovlq %r15, %rax
leal 0x2(,%rax,2), %edx
movq %r14, %rdi
movl $0x2a, %esi
callq 0x727d4
xorl %ebp, %ebp
testq %rax, %rax
je 0x5eedd
movl $0x5, %edx
movq %r14, %rdi
leaq 0x64e00(%rip), %rsi     # 0xc3c69
callq 0x72874
testq %rax, %rax
je 0x5eedd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5e739
testl %eax, %eax
je 0x5eedd
movq %r14, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x5eeee
xorl %ebp, %ebp
testl %eax, %eax
je 0x5eedd
movq %r14, %rdi
movq %r12, %rsi
movl $0x2, %edx
callq 0x5eeee
testl %eax, %eax
je 0x5eedd
incq %r13
cmpq $0x40, %r13
movl $0x0, %eax
cmoveq %rax, %r13
decq %r15
movq %r12, %rdi
callq 0x55d03
cmpl $-0x1, %eax
jne 0x5ee29
movq %r12, %rdi
callq 0x55ce7
movl $0x1, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/aof.c
// Function: rioWriteHashIteratorCursor
static int rioWriteHashIteratorCursor(rio *r, hashTypeIterator *hi, int what) {
    if (hi->encoding == OBJ_ENCODING_ZIPLIST) {
        unsigned char *vstr = NULL;
        unsigned int vlen = UINT_MAX;
        long long vll = LLONG_MAX;

        hashTypeCurrentFromZiplist(hi, what, &vstr, &vlen, &vll);
        if (vstr) {
            return rioWriteBulkString(r, (char*)vstr, vlen);
        } else {
            return rioWriteBulkLongLong(r, vll);
        }

    } else if (hi->encoding == OBJ_ENCODING_HT) {
        robj *value;

        hashTypeCurrentFromHashTable(hi, what, &value);
        return rioWriteBulkObject(r, value);
    }

    serverPanic("Unknown hash encoding");
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl 0x8(%rsi), %eax
cmpl $0x2, %eax
je 0x5ef55
cmpl $0x5, %eax
jne 0x5ef89
leaq 0x10(%rsp), %r14
movq $0x0, (%r14)
leaq 0x4(%rsp), %rcx
movl $0xffffffff, (%rcx)     # imm = 0xFFFFFFFF
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
leaq 0x8(%rsp), %r8
movq %rax, (%r8)
movq %rsi, %rdi
movl %edx, %esi
movq %r14, %rdx
callq 0x55df1
movq (%r14), %rsi
testq %rsi, %rsi
je 0x5ef74
movl 0x4(%rsp), %edx
movq %rbx, %rdi
callq 0x72874
jmp 0x5ef81
leaq 0x10(%rsp), %r14
movq %rsi, %rdi
movl %edx, %esi
movq %r14, %rdx
callq 0x55e78
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x5e739
jmp 0x5ef81
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x7296b
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x63af1(%rip), %rdi     # 0xc2a81
leaq 0x65fe4(%rip), %rsi     # 0xc4f7b
movl $0x3d2, %edx            # imm = 0x3D2
callq 0x619b4
movl $0x1, %edi
callq 0x263c0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/aof.c
// Function: aofReadDiffFromParent
ssize_t aofReadDiffFromParent(void) {
    char buf[65536]; /* Default pipe buffer size on most Linux systems. */
    ssize_t nread, total = 0;

    while ((nread =
            read(server.aof_pipe_read_data_from_parent,buf,sizeof(buf))) > 0) {
        server.aof_child_diff = sdscatlen(server.aof_child_diff,buf,nread);
        total += nread;
    }
    return total;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10008, %rsp          # imm = 0x10008
leaq 0xa28e8(%rip), %r12     # 0x1018a8
movl 0x6fc(%r12), %edi
movq %rsp, %rsi
movl $0x10000, %edx          # imm = 0x10000
callq 0x26340
testq %rax, %rax
jle 0x5f01f
movq %rax, %r15
xorl %ebx, %ebx
movq %rsp, %r14
movq 0x718(%r12), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x36ad1
movq %rax, 0x718(%r12)
addq %r15, %rbx
movl 0x6fc(%r12), %edi
movl $0x10000, %edx          # imm = 0x10000
movq %r14, %rsi
callq 0x26340
movq %rax, %r15
testq %rax, %rax
jg 0x5efe2
jmp 0x5f021
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10008, %rsp          # imm = 0x10008
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/./rio.h
// Function: rioWrite
static inline size_t rioWrite(rio *r, const void *buf, size_t len) {
    while (len) {
        size_t bytes_to_write = (r->max_processing_chunk && r->max_processing_chunk < len) ? r->max_processing_chunk : len;
        if (r->update_cksum) r->update_cksum(r,buf,bytes_to_write);
        if (r->write(r,buf,bytes_to_write) == 0)
            return 0;
        buf = (char*)buf + bytes_to_write;
        len -= bytes_to_write;
        r->processed_bytes += bytes_to_write;
    }
    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl $0x1, %ebx
testq %rdx, %rdx
je 0x5f7af
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq 0x20(%r12), %rax
movq 0x38(%r12), %rcx
cmpq %r14, %rcx
movq %r14, %r13
cmovbq %rcx, %r13
testq %rcx, %rcx
cmoveq %r14, %r13
testq %rax, %rax
je 0x5f78b
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq *%rax
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq *0x8(%r12)
testq %rax, %rax
je 0x5f7ad
addq %r13, %r15
addq %r13, 0x30(%r12)
subq %r13, %r14
jne 0x5f760
jmp 0x5f7af
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/aof.c
// Function: aofChildPipeReadable
void aofChildPipeReadable(aeEventLoop *el, int fd, void *privdata, int mask) {
    char byte;
    UNUSED(el);
    UNUSED(privdata);
    UNUSED(mask);

    if (read(fd,&byte,1) == 1 && byte == '!') {
        serverLog(LL_NOTICE,"AOF rewrite child asks to stop sending diffs.");
        server.aof_stop_sending_diff = 1;
        if (write(server.aof_pipe_write_ack_to_child,"!",1) != 1) {
            /* If we can't send the ack, inform the user, but don't try again
             * since in the other side the children will use a timeout if the
             * kernel can't buffer our write, or, the children was
             * terminated. */
            serverLog(LL_WARNING,"Can't send ACK to AOF child: %s",
                strerror(errno));
        }
    }
    /* Remove the handler since this can be called only one time during a
     * rewrite. */
    aeDeleteFileEvent(server.el,server.aof_pipe_read_ack_from_child,AE_READABLE);
}

// Assembly:
pushq %rax
movl %esi, %edi
leaq 0x7(%rsp), %rsi
movl $0x1, %edx
callq 0x26340
cmpq $0x1, %rax
jne 0x5f83e
cmpb $0x21, 0x7(%rsp)
jne 0x5f83e
leaq 0x6613a(%rip), %rsi     # 0xc591c
movl $0x2, %edi
xorl %eax, %eax
callq 0x2fdad
leaq 0xa20b3(%rip), %rax     # 0x1018a8
movl $0x1, 0x710(%rax)
movl 0x708(%rax), %edi
leaq 0x65d09(%rip), %rsi     # 0xc5515
movl $0x1, %edx
callq 0x26bb0
cmpq $0x1, %rax
je 0x5f83e
callq 0x26880
movl (%rax), %edi
callq 0x26680
leaq 0x6611b(%rip), %rsi     # 0xc594a
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2fdad
leaq 0xa2063(%rip), %rax     # 0x1018a8
movq 0x40(%rax), %rdi
movl 0x704(%rax), %esi
movl $0x1, %edx
popq %rax
jmp 0x2cf0e
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/aof.c
// Function: aofCreatePipes
int aofCreatePipes(void) {
    int fds[6] = {-1, -1, -1, -1, -1, -1};
    int j;

    if (pipe(fds) == -1) goto error; /* parent -> children data. */
    if (pipe(fds+2) == -1) goto error; /* children -> parent ack. */
    if (pipe(fds+4) == -1) goto error; /* children -> parent ack. */
    /* Parent -> children data is non blocking. */
    if (anetNonBlock(NULL,fds[0]) != ANET_OK) goto error;
    if (anetNonBlock(NULL,fds[1]) != ANET_OK) goto error;
    if (aeCreateFileEvent(server.el, fds[2], AE_READABLE, aofChildPipeReadable, NULL) == AE_ERR) goto error;

    server.aof_pipe_write_data_to_child = fds[1];
    server.aof_pipe_read_data_from_parent = fds[0];
    server.aof_pipe_write_ack_to_parent = fds[3];
    server.aof_pipe_read_ack_from_child = fds[2];
    server.aof_pipe_write_ack_to_child = fds[5];
    server.aof_pipe_read_ack_from_parent = fds[4];
    server.aof_stop_sending_diff = 0;
    return C_OK;

error:
    serverLog(LL_WARNING,"Error opening /setting AOF rewrite IPC pipes: %s",
        strerror(errno));
    for (j = 0; j < 6; j++) if(fds[j] != -1) close(fds[j]);
    return C_ERR;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
pcmpeqd %xmm0, %xmm0
movq %rsp, %rdi
movdqa %xmm0, (%rdi)
movq $-0x1, 0x10(%rdi)
callq 0x265e0
cmpl $-0x1, %eax
je 0x5f8b9
leaq 0x8(%rsp), %rdi
callq 0x265e0
cmpl $-0x1, %eax
je 0x5f8b9
leaq 0x10(%rsp), %rdi
callq 0x265e0
cmpl $-0x1, %eax
je 0x5f8b9
movl (%rsp), %esi
xorl %edi, %edi
callq 0x2d6a1
testl %eax, %eax
jne 0x5f8b9
movl 0x4(%rsp), %esi
xorl %edi, %edi
callq 0x2d6a1
testl %eax, %eax
je 0x5f902
callq 0x26880
movl (%rax), %edi
callq 0x26680
leaq 0x6609e(%rip), %rsi     # 0xc596a
xorl %ebx, %ebx
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2fdad
movl (%rsp,%rbx,4), %edi
cmpl $-0x1, %edi
je 0x5f8ea
callq 0x26180
incq %rbx
cmpq $0x6, %rbx
jne 0x5f8dd
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0xa1f9f(%rip), %r14     # 0x1018a8
movq 0x40(%r14), %rdi
movl 0x8(%rsp), %esi
leaq -0x15c(%rip), %rcx      # 0x5f7bc
xorl %ebx, %ebx
movl $0x1, %edx
xorl %r8d, %r8d
callq 0x2ce46
cmpl $-0x1, %eax
je 0x5f8b9
pshufd $0xb1, (%rsp), %xmm0    # xmm0 = mem[1,0,3,2]
movdqu %xmm0, 0x6f8(%r14)
movq 0x10(%rsp), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq %xmm0, 0x708(%r14)
movl $0x0, 0x710(%r14)
jmp 0x5f8f8
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/aof.c
// Function: bgrewriteaofCommand
void bgrewriteaofCommand(client *c) {
    if (server.aof_child_pid != -1) {
        addReplyError(c,"Background append only file rewriting already in progress");
    } else if (server.rdb_child_pid != -1) {
        server.aof_rewrite_scheduled = 1;
        addReplyStatus(c,"Background append only file rewriting scheduled");
    } else if (rewriteAppendOnlyFileBackground() == C_OK) {
        addReplyStatus(c,"Background append only file rewriting started");
    } else {
        addReply(c,shared.err);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xa1f41(%rip), %rax     # 0x1018a8
cmpl $-0x1, 0x69c(%rax)
je 0x5f980
leaq 0x660f3(%rip), %rsi     # 0xc5a6a
movq %rbx, %rdi
popq %rbx
jmp 0x3cc06
cmpl $-0x1, 0x730(%rax)
je 0x5f9a3
movl $0x1, 0x698(%rax)
leaq 0x6610a(%rip), %rsi     # 0xc5aa4
movq %rbx, %rdi
popq %rbx
jmp 0x3cdcb
callq 0x5d8b1
testl %eax, %eax
je 0x5f9c0
leaq 0xa295d(%rip), %rax     # 0x102310
movq 0x10(%rax), %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x3c854
leaq 0x6610d(%rip), %rsi     # 0xc5ad4
jmp 0x5f99a
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/pubsub.c
// Function: pubsubSubscribeChannel
int pubsubSubscribeChannel(client *c, robj *channel) {
    dictEntry *de;
    list *clients = NULL;
    int retval = 0;

    /* Add the channel to the client -> channels hash table */
    if (dictAdd(c->pubsub_channels,channel,NULL) == DICT_OK) {
        retval = 1;
        incrRefCount(channel);
        /* Add the client to the channel -> list of clients hash table */
        de = dictFind(server.pubsub_channels,channel);
        if (de == NULL) {
            clients = listCreate();
            dictAdd(server.pubsub_channels,channel,clients);
            incrRefCount(channel);
        } else {
            clients = dictGetVal(de);
        }
        listAddNodeTail(clients,c);
    }
    /* Notify the client */
    addReply(c,shared.mbulkhdr[3]);
    addReply(c,shared.subscribebulk);
    addReplyBulk(c,channel);
    addReplyLongLong(c,clientSubscriptionsCount(c));
    return retval;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x1a8(%rdi), %rdi
xorl %r15d, %r15d
xorl %edx, %edx
callq 0x2e9b8
testl %eax, %eax
jne 0x5fea6
movq %r14, %rdi
callq 0x407a8
leaq 0xa1a51(%rip), %r12     # 0x1018a8
movq 0x988(%r12), %rdi
movq %r14, %rsi
callq 0x2ebca
testq %rax, %rax
je 0x5fe72
movq 0x8(%rax), %r15
jmp 0x5fe95
callq 0x2b17c
movq %rax, %r15
movq 0x988(%r12), %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2e9b8
movq %r14, %rdi
callq 0x407a8
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2b24b
movl $0x1, %r15d
leaq 0xa2463(%rip), %r12     # 0x102310
movq 0x13a48(%r12), %rsi
movq %rbx, %rdi
callq 0x3c854
movq 0x108(%r12), %rsi
movq %rbx, %rdi
callq 0x3c854
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3d170
movq 0x1a8(%rbx), %rax
movl 0x48(%rax), %ecx
addl 0x28(%rax), %ecx
movq 0x1b0(%rbx), %rax
addl 0x28(%rax), %ecx
movslq %ecx, %rsi
movq %rbx, %rdi
callq 0x3d23f
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/pubsub.c
// Function: pubsubUnsubscribeChannel
int pubsubUnsubscribeChannel(client *c, robj *channel, int notify) {
    dictEntry *de;
    list *clients;
    listNode *ln;
    int retval = 0;

    /* Remove the channel from the client -> channels hash table */
    incrRefCount(channel); /* channel may be just a pointer to the same object
                            we have in the hash tables. Protect it... */
    if (dictDelete(c->pubsub_channels,channel) == DICT_OK) {
        retval = 1;
        /* Remove the client from the channel -> clients list hash table */
        de = dictFind(server.pubsub_channels,channel);
        serverAssertWithInfo(c,NULL,de != NULL);
        clients = dictGetVal(de);
        ln = listSearchKey(clients,c);
        serverAssertWithInfo(c,NULL,ln != NULL);
        listDelNode(clients,ln);
        if (listLength(clients) == 0) {
            /* Free the list and associated hash entry at all if this was
             * the latest client, so that it will be possible to abuse
             * Redis PUBSUB creating millions of channels. */
            dictDelete(server.pubsub_channels,channel);
        }
    }
    /* Notify the client */
    if (notify) {
        addReply(c,shared.mbulkhdr[3]);
        addReply(c,shared.unsubscribebulk);
        addReplyBulk(c,channel);
        addReplyLongLong(c,dictSize(c->pubsub_channels)+
                       listLength(c->pubsub_patterns));

    }
    decrRefCount(channel); /* it is finally safe to release it */
    return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x407a8
movq 0x1a8(%rbx), %rdi
movq %r14, %rsi
callq 0x2ecb5
xorl %r15d, %r15d
testl %eax, %eax
jne 0x5ff99
leaq 0xa1967(%rip), %r13     # 0x1018a8
movq 0x988(%r13), %rdi
movq %r14, %rsi
callq 0x2ebca
testq %rax, %rax
je 0x6000b
movq 0x8(%rax), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2b470
testq %rax, %rax
je 0x60026
movq %r12, %rdi
movq %rax, %rsi
callq 0x2b331
movl $0x1, %r15d
cmpq $0x0, 0x28(%r12)
jne 0x5ff99
movq 0x988(%r13), %rdi
movq %r14, %rsi
callq 0x2ecb5
testl %ebp, %ebp
je 0x5fff1
leaq 0xa236c(%rip), %r12     # 0x102310
movq 0x13a48(%r12), %rsi
movq %rbx, %rdi
callq 0x3c854
movq 0x110(%r12), %rsi
movq %rbx, %rdi
callq 0x3c854
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3d170
movq 0x1a8(%rbx), %rax
movq 0x1b0(%rbx), %rcx
movq 0x48(%rax), %rsi
addq 0x28(%rax), %rsi
addq 0x28(%rcx), %rsi
movq %rbx, %rdi
callq 0x3d23f
movq %r14, %rdi
callq 0x40c8f
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x610c3(%rip), %rdx     # 0xc10d5
leaq 0x65dbb(%rip), %rcx     # 0xc5dd4
movq %rbx, %rdi
xorl %esi, %esi
movl $0x65, %r8d
jmp 0x6003f
leaq 0x5ffd7(%rip), %rdx     # 0xc0004
leaq 0x65da0(%rip), %rcx     # 0xc5dd4
movq %rbx, %rdi
xorl %esi, %esi
movl $0x68, %r8d
callq 0x627c3
movl $0x1, %edi
callq 0x263c0