LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/debug.c
// Function: serverLogObjectDebugInfo
void serverLogObjectDebugInfo(robj *o) {
    serverLog(LL_WARNING,"Object type: %u", o->type);
    serverLog(LL_WARNING,"Object encoding: %u", o->encoding);
    serverLog(LL_WARNING,"Object refcount: %d", o->refcount);
    if (o->type == OBJ_STRING && sdsEncodedObject(o)) {
        serverLog(LL_WARNING,"Object raw string len: %zu", sdslen(o->ptr));
        if (sdslen(o->ptr) < 4096) {
            sds repr = sdscatrepr(sdsempty(),o->ptr,sdslen(o->ptr));
            serverLog(LL_WARNING,"Object raw string content: %s", repr);
            sdsfree(repr);
        }
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %edx
andl $0xf, %edx
leaq 0x2b693(%rip), %rsi     # 0x5630b
movl $0x3, %edi
xorl %eax, %eax
callq 0x19fb1
movl (%rbx), %edx
shrl $0x4, %edx
andl $0xf, %edx
leaq 0x2b688(%rip), %rsi     # 0x5631b
movl $0x3, %edi
xorl %eax, %eax
callq 0x19fb1
movl 0x4(%rbx), %edx
leaq 0x2b686(%rip), %rsi     # 0x5632f
movl $0x3, %edi
xorl %eax, %eax
callq 0x19fb1
movl (%rbx), %eax
testb $0xf, %al
je 0x2acc3
addq $0x8, %rsp
popq %rbx
popq %r14
retq
shrl $0x4, %eax
testb $0xd, %al
jne 0x2acbb
movq 0x8(%rbx), %rax
movzbl -0x1(%rax), %edx
movl %edx, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x2ad08
leaq 0x2b2a9(%rip), %rsi     # 0x55f8c
movslq (%rsi,%rcx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
shrl $0x3, %edx
jmp 0x2ad0a
movq -0x11(%rax), %rdx
jmp 0x2ad0a
movzwl -0x5(%rax), %edx
jmp 0x2ad0a
movl -0x9(%rax), %edx
jmp 0x2ad0a
movzbl -0x3(%rax), %edx
jmp 0x2ad0a
xorl %edx, %edx
leaq 0x2b632(%rip), %rsi     # 0x56343
xorl %r14d, %r14d
movl $0x3, %edi
xorl %eax, %eax
callq 0x19fb1
movq 0x8(%rbx), %rcx
movzbl -0x1(%rcx), %eax
movl %eax, %edx
andl $0x7, %edx
cmpl $0x4, %edx
ja 0x2ad62
leaq 0x2b267(%rip), %rsi     # 0x55fa0
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
shrl $0x3, %eax
movq %rax, %r14
jmp 0x2ad62
movq -0x11(%rcx), %r14
jmp 0x2ad62
movzwl -0x5(%rcx), %r14d
jmp 0x2ad62
movl -0x9(%rcx), %r14d
jmp 0x2ad62
movzbl -0x3(%rcx), %r14d
cmpq $0xfff, %r14            # imm = 0xFFF
ja 0x2acbb
callq 0x1de3f
movq 0x8(%rbx), %rsi
movzbl -0x1(%rsi), %edx
movl %edx, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x2adb2
leaq 0x2b227(%rip), %rdi     # 0x55fb4
movslq (%rdi,%rcx,4), %rcx
addq %rdi, %rcx
jmpq *%rcx
shrl $0x3, %edx
jmp 0x2adb4
movq -0x11(%rsi), %rdx
jmp 0x2adb4
movzwl -0x5(%rsi), %edx
jmp 0x2adb4
movl -0x9(%rsi), %edx
jmp 0x2adb4
movzbl -0x3(%rsi), %edx
jmp 0x2adb4
xorl %edx, %edx
movq %rax, %rdi
callq 0x1f7c8
movq %rax, %rbx
leaq 0x2b598(%rip), %rsi     # 0x5635e
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x19fb1
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1ded3
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/debug.c
// Function: serverPanic
void _serverPanic(char *msg, char *file, int line) {
    bugReportStart();
    serverLog(LL_WARNING,"------------------------------------------------");
    serverLog(LL_WARNING,"!!! Software Failure. Press left mouse button to continue");
    serverLog(LL_WARNING,"Guru Meditation: %s #%s:%d",msg,file,line);
#ifdef HAVE_BACKTRACE
    serverLog(LL_WARNING,"(forcing SIGSEGV in order to print the stack trace)");
#endif
    serverLog(LL_WARNING,"------------------------------------------------");
    *((char*)-1) = 'x';
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x4428d(%rip), %r12     # 0x6f088
cmpl $0x0, 0x694(%r12)
jne 0x2ae25
leaq 0x2b629(%rip), %rsi     # 0x56436
movl $0x3, %edi
xorl %eax, %eax
callq 0x19fb1
movl $0x1, 0x694(%r12)
leaq 0x2b550(%rip), %r12     # 0x5637c
movl $0x3, %edi
movq %r12, %rsi
xorl %eax, %eax
callq 0x19fb1
leaq 0x2b56b(%rip), %rsi     # 0x563ad
movl $0x3, %edi
xorl %eax, %eax
callq 0x19fb1
leaq 0x2b592(%rip), %rsi     # 0x563e7
movl $0x3, %edi
movq %r15, %rdx
movq %r14, %rcx
movl %ebx, %r8d
xorl %eax, %eax
callq 0x19fb1
leaq 0x2b591(%rip), %rsi     # 0x56402
movl $0x3, %edi
xorl %eax, %eax
callq 0x19fb1
movl $0x3, %edi
movq %r12, %rsi
xorl %eax, %eax
callq 0x19fb1
movb $0x78, -0x1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/debug.c
// Function: logStackContent
void logStackContent(void **sp) {
    int i;
    for (i = 15; i >= 0; i--) {
        unsigned long addr = (unsigned long) sp+i;
        unsigned long val = (unsigned long) sp[i];

        if (sizeof(long) == 4)
            serverLog(LL_WARNING, "(%08lx) -> %08lx", addr, val);
        else
            serverLog(LL_WARNING, "(%016lx) -> %016lx", addr, val);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0xf, %r15d
leaq 0x2b5c3(%rip), %r14     # 0x56478
leaq (%rbx,%r15), %rdx
movq (%rbx,%r15,8), %rcx
movl $0x3, %edi
movq %r14, %rsi
xorl %eax, %eax
callq 0x19fb1
addq $-0x1, %r15
jb 0x2aeb5
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/debug.c
// Function: logStackTrace
void logStackTrace(ucontext_t *uc) {
    void *trace[100];
    int trace_size = 0, fd;
    int log_to_stdout = server.logfile[0] == '\0';

    /* Open the log file in append mode. */
    fd = log_to_stdout ?
        STDOUT_FILENO :
        open(server.logfile, O_APPEND|O_CREAT|O_WRONLY, 0644);
    if (fd == -1) return;

    /* Generate the stack trace */
    trace_size = backtrace(trace, 100);

    /* overwrite sigaction with caller's address */
    if (getMcontextEip(uc) != NULL)
        trace[1] = getMcontextEip(uc);

    /* Write symbols to log file */
    backtrace_symbols_fd(trace, trace_size, fd);

    /* Cleanup */
    if (!log_to_stdout) close(fd);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x320, %rsp            # imm = 0x320
movq %rdi, %r14
leaq 0x44049(%rip), %rax     # 0x6f088
movq 0x5f0(%rax), %rdi
movb (%rdi), %bpl
testb %bpl, %bpl
je 0x2b063
movl $0x441, %esi            # imm = 0x441
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x126f0
movl %eax, %ebx
jmp 0x2b068
movl $0x1, %ebx
cmpl $-0x1, %ebx
je 0x2b0a3
movq %rsp, %rdi
movl $0x64, %esi
callq 0x12260
movq 0xa8(%r14), %rcx
testq %rcx, %rcx
je 0x2b08b
movq %rcx, 0x8(%rsp)
movq %rsp, %rdi
movl %eax, %esi
movl %ebx, %edx
callq 0x120a0
testb %bpl, %bpl
je 0x2b0a3
movl %ebx, %edi
callq 0x123b0
addq $0x320, %rsp            # imm = 0x320
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/debug.c
// Function: logCurrentClient
void logCurrentClient(void) {
    if (server.current_client == NULL) return;

    client *cc = server.current_client;
    sds client;
    int j;

    serverLog(LL_WARNING, "--- CURRENT CLIENT INFO");
    client = catClientInfoString(sdsempty(),cc);
    serverLog(LL_WARNING,"client: %s", client);
    sdsfree(client);
    for (j = 0; j < cc->argc; j++) {
        robj *decoded;

        decoded = getDecodedObject(cc->argv[j]);
        serverLog(LL_WARNING,"argv[%d]: '%s'", j, (char*)decoded->ptr);
        decrRefCount(decoded);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x43fca(%rip), %rax     # 0x6f088
movq 0x200(%rax), %rbx
testq %rbx, %rbx
je 0x2b15c
leaq 0x2b499(%rip), %rsi     # 0x5656e
movl $0x3, %edi
xorl %eax, %eax
callq 0x19fb1
callq 0x1de3f
movq %rax, %rdi
movq %rbx, %rsi
callq 0x23e1d
movq %rax, %r14
leaq 0x29d5e(%rip), %rsi     # 0x54e59
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x19fb1
movq %r14, %rdi
callq 0x1ded3
cmpl $0x0, 0x28(%rbx)
jle 0x2b15c
leaq 0x2b467(%rip), %r14     # 0x56586
xorl %r15d, %r15d
movq 0x30(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x26071
movq %rax, %r12
movq 0x8(%rax), %rcx
movl $0x3, %edi
movq %r14, %rsi
movl %r15d, %edx
xorl %eax, %eax
callq 0x19fb1
movq %r12, %rdi
callq 0x25d25
incq %r15
movslq 0x28(%rbx), %rax
cmpq %rax, %r15
jl 0x2b122
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/debug.c
// Function: serverLogHexDump
void serverLogHexDump(int level, char *descr, void *value, size_t len) {
    char buf[65], *b;
    unsigned char *v = value;
    char charset[] = "0123456789abcdef";

    serverLog(level,"%s (hexdump):", descr);
    b = buf;
    while(len) {
        b[0] = charset[(*v)>>4];
        b[1] = charset[(*v)&0xf];
        b[2] = '\0';
        b += 2;
        len--;
        v++;
        if (b-buf == 64 || len == 0) {
            serverLogRaw(level|LL_RAW,buf);
            b = buf;
        }
    }
    serverLogRaw(level|LL_RAW,"\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rdx
leaq 0x2b1ee(%rip), %rsi     # 0x56853
movl %edi, (%rsp)
xorl %eax, %eax
callq 0x19fb1
testq %r14, %r14
je 0x2b6f9
movl (%rsp), %eax
orl $0x400, %eax            # imm = 0x400
movl %eax, 0x4(%rsp)
leaq -0x1(%r14), %r13
leaq 0x10(%rsp), %rbp
xorl %ebx, %ebx
leaq 0x2b1fa(%rip), %r12     # 0x56890
movq %rbp, %rcx
negq %rcx
movq %rcx, 0x8(%rsp)
movzbl (%r15,%rbx), %ecx
shrl $0x4, %ecx
movb (%rcx,%r12), %cl
movb %cl, (%rbp)
movzbl (%r15,%rbx), %ecx
andl $0xf, %ecx
movb (%rcx,%r12), %cl
movb %cl, 0x1(%rbp)
movb $0x0, 0x2(%rbp)
cmpq %rbx, %r13
je 0x2b6e0
movq 0x8(%rsp), %rcx
addq %rbp, %rcx
addq $0x2, %rcx
cmpq $0x40, %rcx
je 0x2b6e0
addq $0x2, %rbp
jmp 0x2b6f1
movl 0x4(%rsp), %edi
leaq 0x10(%rsp), %rbp
movq %rbp, %rsi
callq 0x19e3d
incq %rbx
cmpq %rbx, %r14
jne 0x2b6a1
movl (%rsp), %edi
orl $0x400, %edi            # imm = 0x400
leaq 0x2867f(%rip), %rsi     # 0x53d88
callq 0x19e3d
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/debug.c
// Function: watchdogScheduleSignal
void watchdogScheduleSignal(int period) {
    struct itimerval it;

    /* Will stop the timer if period is 0. */
    it.it_value.tv_sec = period/1000;
    it.it_value.tv_usec = (period%1000)*1000;
    /* Don't automatically restart. */
    it.it_interval.tv_sec = 0;
    it.it_interval.tv_usec = 0;
    setitimer(ITIMER_REAL, &it, NULL);
}

// Assembly:
subq $0x28, %rsp
movslq %edi, %rax
imulq $0x10624dd3, %rax, %rcx # imm = 0x10624DD3
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rcx
addl %edx, %ecx
movslq %ecx, %rcx
movq %rsp, %rsi
movq %rcx, 0x10(%rsi)
imull $0x3e8, %ecx, %ecx      # imm = 0x3E8
subl %ecx, %eax
imull $0x3e8, %eax, %eax      # imm = 0x3E8
cltq
movq %rax, 0x18(%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsi)
xorl %edi, %edi
xorl %edx, %edx
callq 0x12650
addq $0x28, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/debug.c
// Function: enableWatchdog
void enableWatchdog(int period) {
    int min_period;

    if (server.watchdog_period == 0) {
        struct sigaction act;

        /* Watchdog was actually disabled, so we have to setup the signal
         * handler. */
        sigemptyset(&act.sa_mask);
        act.sa_flags = SA_ONSTACK | SA_SIGINFO;
        act.sa_sigaction = watchdogSignalHandler;
        sigaction(SIGALRM, &act, NULL);
    }
    /* If the configured period is smaller than twice the timer period, it is
     * too short for the software watchdog to work reliably. Fix it now
     * if needed. */
    min_period = (1000/server.hz)*2;
    if (period < min_period) period = min_period;
    watchdogScheduleSignal(period); /* Adjust the current timer. */
    server.watchdog_period = period;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movl %edi, %ebx
leaq 0x438da(%rip), %r15     # 0x6f088
cmpl $0x0, 0x698(%r15)
jne 0x2b7ea
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x124f0
movl $0x8000004, 0x80(%r14) # imm = 0x8000004
leaq -0xba(%rip), %rax       # 0x2b71d
movq %rax, -0x8(%r14)
movq %rsp, %rsi
movl $0xe, %edi
xorl %edx, %edx
callq 0x12170
movl $0x3e8, %eax            # imm = 0x3E8
xorl %edx, %edx
idivl 0x20(%r15)
addl %eax, %eax
cmpl %ebx, %eax
cmovlel %ebx, %eax
movslq %eax, %rbx
imulq $0x10624dd3, %rbx, %rax # imm = 0x10624DD3
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x26, %rax
addl %ecx, %eax
cltq
movq %rsp, %rsi
movq %rax, 0x10(%rsi)
imull $0x3e8, %eax, %eax      # imm = 0x3E8
movl %ebx, %ecx
subl %eax, %ecx
imull $0x3e8, %ecx, %eax      # imm = 0x3E8
cltq
movq %rax, 0x18(%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsi)
xorl %edi, %edi
xorl %edx, %edx
callq 0x12650
movl %ebx, 0x698(%r15)
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/debug.c
// Function: disableWatchdog
void disableWatchdog(void) {
    struct sigaction act;
    if (server.watchdog_period == 0) return; /* Already disabled. */
    watchdogScheduleSignal(0); /* Stop the current timer. */

    /* Set the signal handler to SIG_IGN, this will also remove pending
     * signals from the queue. */
    sigemptyset(&act.sa_mask);
    act.sa_flags = 0;
    act.sa_handler = SIG_IGN;
    sigaction(SIGALRM, &act, NULL);
    server.watchdog_period = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xa0, %rsp
leaq 0x43820(%rip), %r14     # 0x6f088
cmpl $0x0, 0x698(%r14)
je 0x2b8bd
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
xorl %r15d, %r15d
xorl %edi, %edi
xorl %edx, %edx
callq 0x12650
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x124f0
movl %r15d, 0x80(%rbx)
movq $0x1, -0x8(%rbx)
movq %rsp, %rsi
movl $0xe, %edi
xorl %edx, %edx
callq 0x12170
movl %r15d, 0x698(%r14)
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/syncio.c
// Function: syncWrite
ssize_t syncWrite(int fd, char *ptr, ssize_t size, long long timeout) {
    ssize_t nwritten, ret = size;
    long long start = mstime();
    long long remaining = timeout;

    while(1) {
        long long wait = (remaining > DISCNT_SYNCIO_RESOLUTION) ?
                          remaining : DISCNT_SYNCIO_RESOLUTION;
        long long elapsed;

        /* Optimistically try to write before checking if the file descriptor
         * is actually writable. At worst we get EAGAIN. */
        nwritten = write(fd,ptr,size);
        if (nwritten == -1) {
            if (errno != EAGAIN) return -1;
        } else {
            ptr += nwritten;
            size -= nwritten;
        }
        if (size == 0) return ret;

        /* Wait */
        aeWait(fd,AE_WRITABLE,wait);
        elapsed = mstime() - start;
        if (elapsed >= timeout) {
            errno = ETIMEDOUT;
            return -1;
        }
        remaining = timeout - elapsed;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, %r13
movq %rsi, %r15
movl %edi, %ebp
callq 0x1a1d3
movq %rax, 0x8(%rsp)
movq %r13, (%rsp)
movq %rbx, 0x10(%rsp)
cmpq $0xb, %rbx
movl $0xa, %r12d
cmovgeq %rbx, %r12
movl %ebp, %edi
movq %r15, %rsi
movq %r13, %rdx
callq 0x121e0
cmpq $-0x1, %rax
je 0x2b921
addq %rax, %r15
subq %rax, %r13
jmp 0x2b92b
callq 0x120d0
cmpl $0xb, (%rax)
jne 0x2b96e
testq %r13, %r13
je 0x2b95a
movl %ebp, %edi
movl $0x2, %esi
movq %r12, %rdx
callq 0x1773c
callq 0x1a1d3
subq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
subq %rax, %rcx
jle 0x2b963
movb $0x1, %al
movq %rcx, %rbx
jmp 0x2b977
xorl %r13d, %r13d
movq (%rsp), %r14
jmp 0x2b975
callq 0x120d0
movl $0x6e, (%rax)
movq $-0x1, %r14
xorl %eax, %eax
testb %al, %al
jne 0x2b8f8
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/syncio.c
// Function: syncRead
ssize_t syncRead(int fd, char *ptr, ssize_t size, long long timeout) {
    ssize_t nread, totread = 0;
    long long start = mstime();
    long long remaining = timeout;

    if (size == 0) return 0;
    while(1) {
        long long wait = (remaining > DISCNT_SYNCIO_RESOLUTION) ?
                          remaining : DISCNT_SYNCIO_RESOLUTION;
        long long elapsed;

        /* Optimistically try to read before checking if the file descriptor
         * is actually readable. At worst we get EAGAIN. */
        nread = read(fd,ptr,size);
        if (nread == 0) return -1; /* short read. */
        if (nread == -1) {
            if (errno != EAGAIN) return -1;
        } else {
            ptr += nread;
            size -= nread;
            totread += nread;
        }
        if (size == 0) return totread;

        /* Wait */
        aeWait(fd,AE_READABLE,wait);
        elapsed = mstime() - start;
        if (elapsed >= timeout) {
            errno = ETIMEDOUT;
            return -1;
        }
        remaining = timeout - elapsed;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r14
movl %edi, 0xc(%rsp)
callq 0x1a1d3
movq %rax, 0x20(%rsp)
testq %r15, %r15
je 0x2ba6d
movq $0x0, 0x10(%rsp)
movq %rbx, 0x18(%rsp)
cmpq $0xb, %rbx
movl $0xa, %r12d
cmovgeq %rbx, %r12
movl 0xc(%rsp), %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x12420
movq $-0x1, %rbp
testq %rax, %rax
je 0x2ba5e
cmpq $-0x1, %rax
jne 0x2ba08
callq 0x120d0
cmpl $0xb, (%rax)
je 0x2ba13
jmp 0x2ba5e
addq %rax, %r14
subq %rax, %r15
addq %rax, 0x10(%rsp)
testq %r15, %r15
je 0x2ba47
movl 0xc(%rsp), %edi
movl $0x1, %esi
movq %r12, %rdx
callq 0x1773c
callq 0x1a1d3
subq 0x20(%rsp), %rax
movq 0x18(%rsp), %rcx
subq %rax, %rcx
jle 0x2ba53
movb $0x1, %al
movq %rcx, %rbx
movq %r13, %rbp
jmp 0x2ba60
xorl %r15d, %r15d
xorl %eax, %eax
movq 0x10(%rsp), %rbp
jmp 0x2ba60
callq 0x120d0
movl $0x6e, (%rax)
xorl %eax, %eax
movq %rbp, %r13
testb %al, %al
jne 0x2b9cd
jmp 0x2ba6f
xorl %ebp, %ebp
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_O1/erikdubbelboer[P]discnt/src/syncio.c
// Function: syncReadLine
ssize_t syncReadLine(int fd, char *ptr, ssize_t size, long long timeout) {
    ssize_t nread = 0;

    size--;
    while(size) {
        char c;

        if (syncRead(fd,&c,1,timeout) == -1) return -1;
        if (c == '\n') {
            *ptr = '\0';
            if (nread && *(ptr-1) == '\r') *(ptr-1) = '\0';
            return nread;
        } else {
            *ptr++ = c;
            *ptr = '\0';
            nread++;
        }
        size--;
    }
    return nread;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
decq %r14
xorl %r13d, %r13d
testq %r14, %r14
je 0x2bb04
movl $0x1, %edx
movl %ebp, %edi
leaq 0x7(%rsp), %rsi
movq %rbx, %rcx
callq 0x2b991
cmpq $-0x1, %rax
je 0x2bae0
movb 0x7(%rsp), %al
cmpb $0xa, %al
jne 0x2baeb
movb $0x0, (%r15)
testq %r13, %r13
je 0x2bad9
cmpb $0xd, -0x1(%r15)
jne 0x2bad9
movb $0x0, -0x1(%r15)
xorl %eax, %eax
movq %r13, %r12
jmp 0x2bafe
movq $-0x1, %r12
xorl %eax, %eax
jmp 0x2bafe
movb %al, (%r15)
movb $0x0, 0x1(%r15)
incq %r15
incq %r13
decq %r14
movb $0x1, %al
testb %al, %al
jne 0x2ba9d
jmp 0x2bb07
movq %r13, %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: createClusterNode
clusterNode *createClusterNode(char *nodename, int flags) {
    clusterNode *node = zmalloc(sizeof(*node));

    if (nodename)
        memcpy(node->name, nodename, CLUSTER_NAMELEN);
    else
        getRandomHexChars(node->name, CLUSTER_NAMELEN);
    node->ctime = mstime();
    node->flags = flags;
    node->ping_sent = node->pong_received = 0;
    node->fail_time = 0;
    node->link = NULL;
    memset(node->ip,0,sizeof(node->ip));
    node->port = 0;
    node->fail_reports = listCreate();
    listSetFreeMethod(node->fail_reports,zfree);
    return node;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movl $0x98, %edi
callq 0x1fea5
movq %rax, %rbx
testq %r14, %r14
je 0x2bf9e
movq 0x20(%r14), %rax
movq %rax, 0x20(%rbx)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
jmp 0x2bfab
movq %rbx, %rdi
movl $0x28, %esi
callq 0x25612
callq 0x1a1d3
movq %rax, 0x28(%rbx)
movl %ebp, 0x30(%rbx)
xorl %eax, %eax
movq %rax, 0x88(%rbx)
movl $0x0, 0x80(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
movups %xmm0, 0x48(%rbx)
movups %xmm0, 0x58(%rbx)
movups %xmm0, 0x68(%rbx)
movq %rax, 0x76(%rbx)
callq 0x16a2c
movq %rax, 0x90(%rbx)
leaq -0xbff5(%rip), %rcx     # 0x1ffff
movq %rcx, 0x18(%rax)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterGenNodesDescription
sds clusterGenNodesDescription(int filter) {
    sds ci = sdsempty(), ni;
    dictIterator *di;
    dictEntry *de;

    di = dictGetSafeIterator(server.cluster->nodes);
    while((de = dictNext(di)) != NULL) {
        clusterNode *node = dictGetVal(de);

        if (node->flags & filter) continue;
        ni = clusterGenNodeDescription(node);
        ci = sdscatsds(ci,ni);
        sdsfree(ni);
        ci = sdscatlen(ci,"\n",1);
    }
    dictReleaseIterator(di);
    return ci;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edi, %ebx
callq 0x1de3f
movq %rax, %r15
leaq 0x42e56(%rip), %rax     # 0x6f088
movq 0x668(%rax), %rax
movq 0x10(%rax), %rdi
callq 0x1926c
movq %rax, %r14
movq %rax, %rdi
callq 0x1929d
testq %rax, %rax
je 0x2c2a0
leaq 0x27b2f(%rip), %r12     # 0x53d88
movq 0x8(%rax), %rdi
testl %ebx, 0x30(%rdi)
jne 0x2c293
callq 0x2e4c9
movq %rax, %r13
movq %r15, %rdi
movq %rax, %rsi
callq 0x1e764
movq %rax, %r15
movq %r13, %rdi
callq 0x1ded3
movl $0x1, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x1e66d
movq %rax, %r15
movq %r14, %rdi
callq 0x1929d
testq %rax, %rax
jne 0x2c259
movq %r14, %rdi
callq 0x1935a
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterLockConfig
int clusterLockConfig(char *filename) {
/* flock() does not exist on Solaris
 * and a fcntl-based solution won't help, as we constantly re-open that file,
 * which will release _all_ locks anyway
 */
#if !defined(__sun)
    /* To lock it, we need to open the file in a way it is created if
     * it does not exist, otherwise there is a race condition with other
     * processes. */
    int fd = open(filename,O_WRONLY|O_CREAT,0644);
    if (fd == -1) {
        serverLog(LL_WARNING,
            "Can't open %s in order to acquire a lock: %s",
            filename, strerror(errno));
        return C_ERR;
    }

    if (flock(fd,LOCK_EX|LOCK_NB) == -1) {
        if (errno == EWOULDBLOCK) {
            serverLog(LL_WARNING,
                 "Sorry, the cluster configuration file %s is already used "
                 "by a different Discnt node. Please make sure that "
                 "different nodes use different cluster configuration "
                 "files.", filename);
        } else {
            serverLog(LL_WARNING,
                "Impossible to lock %s: %s", filename, strerror(errno));
        }
        close(fd);
        return C_ERR;
    }
    /* Lock acquired: leak the 'fd' by not closing it, so that we'll retain the
     * lock to the file as long as the process exists. */
#endif /* __sun */

    return C_OK;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
movl $0x41, %esi
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x126f0
cmpl $-0x1, %eax
je 0x2c336
movl %eax, %ebp
movl %eax, %edi
movl $0x6, %esi
callq 0x12810
cmpl $-0x1, %eax
jne 0x2c388
callq 0x120d0
movl (%rax), %edi
cmpl $0xb, %edi
jne 0x2c35d
leaq 0x2a88a(%rip), %rsi     # 0x56baf
movl $0x3, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x19fb1
jmp 0x2c37b
callq 0x120d0
movl (%rax), %edi
callq 0x128f0
leaq 0x2a839(%rip), %rsi     # 0x56b82
movl $0x3, %edi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x19fb1
jmp 0x2c382
callq 0x128f0
leaq 0x2a8ec(%rip), %rsi     # 0x56c55
movl $0x3, %edi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x19fb1
movl %ebp, %edi
callq 0x123b0
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterAcceptHandler
void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
    int cport, cfd;
    int max = MAX_CLUSTER_ACCEPTS_PER_CALL;
    char cip[NET_IP_STR_LEN];
    clusterLink *link;
    UNUSED(el);
    UNUSED(mask);
    UNUSED(privdata);

    while(max--) {
        cfd = anetTcpAccept(server.neterr, fd, cip, sizeof(cip), &cport);
        if (cfd == ANET_ERR) {
            if (errno != EWOULDBLOCK)
                serverLog(LL_VERBOSE,
                    "Accepting cluster node: %s", server.neterr);
            return;
        }
        anetNonBlock(NULL,cfd);
        anetEnableTcpNoDelay(NULL,cfd);

        /* Use non-blocking I/O for cluster messages. */
        serverLog(LL_VERBOSE,"Accepted cluster node %s:%d", cip, cport);
        /* Create a link object we use to handle the connection.
         * It gets passed to the readable handler when data is available.
         * Initiallly the link->node pointer is set to NULL as we don't know
         * which node is, but the right node is references once we know the
         * node identity. */
        link = createClusterLink(NULL);
        link->fd = cfd;
        aeCreateFileEvent(server.el,cfd,AE_READABLE,clusterReadHandler,link);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, %ebx
movl $0xfffffc18, %r12d      # imm = 0xFFFFFC18
movl $0x218, %r14d           # imm = 0x218
addq 0x41a14(%rip), %r14     # 0x6dfb8
leaq 0x10(%rsp), %r15
leaq 0x39b(%rip), %rbp       # 0x2c94b
movl $0x2e, %ecx
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
leaq 0xc(%rsp), %r8
callq 0x18386
cmpl $-0x1, %eax
je 0x2c62c
movl %eax, %r13d
xorl %edi, %edi
movl %eax, %esi
callq 0x178ed
xorl %edi, %edi
movl %r13d, %esi
callq 0x17a1f
movl 0xc(%rsp), %ecx
movl $0x1, %edi
leaq 0x2a7ac(%rip), %rsi     # 0x56d9e
movq %r15, %rdx
xorl %eax, %eax
callq 0x19fb1
xorl %edi, %edi
callq 0x2c894
movl %r13d, 0x8(%rax)
leaq 0x42a7a(%rip), %rcx     # 0x6f088
movq 0x38(%rcx), %rdi
movl %r13d, %esi
movl $0x1, %edx
movq %rbp, %rcx
movq %rax, %r8
callq 0x17077
incl %r12d
jne 0x2c5b0
jmp 0x2c655
callq 0x120d0
cmpl $0xb, (%rax)
je 0x2c655
movl $0x218, %edx            # imm = 0x218
addq 0x41976(%rip), %rdx     # 0x6dfb8
leaq 0x2a73a(%rip), %rsi     # 0x56d83
movl $0x1, %edi
xorl %eax, %eax
callq 0x19fb1
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterUpdateState
void clusterUpdateState(void) {
    server.cluster->todo_before_sleep &= ~CLUSTER_TODO_UPDATE_STATE;

    /* Compute the cluster size, that is the number of nodes
     * actually partecipating to the cluster (so nodes in handshake
     * state are excluded).
     *
     * Discnt does not use any quorum, so this is only useful in order to
     * mark node from PFAIL to FAIL when we have failure reports from
     * majority. The notion of failure is only used for optimizations,
     * for example if a node appears to be failing we don't try to send
     * it ACKs or replicate messages to it. */
    {
        dictIterator *di;
        dictEntry *de;

        server.cluster->size = 0;
        di = dictGetSafeIterator(server.cluster->nodes);
        while((de = dictNext(di)) != NULL) {
            clusterNode *node = dictGetVal(de);

            if (!(node->flags & CLUSTER_NODE_HANDSHAKE))
                server.cluster->size++;
        }
        dictReleaseIterator(di);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x42a19(%rip), %r14     # 0x6f088
movq 0x668(%r14), %rax
andl $-0x2, 0x28(%rax)
movl $0x0, 0xc(%rax)
movq 0x10(%rax), %rdi
callq 0x1926c
movq %rax, %rbx
movq %rax, %rdi
callq 0x1929d
testq %rax, %rax
je 0x2c6b3
movq 0x8(%rax), %rax
testb $0x8, 0x30(%rax)
jne 0x2c6ae
movq 0x668(%r14), %rax
incl 0xc(%rax)
movq %rbx, %rdi
jmp 0x2c690
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1935a
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterUpdateReachableNodes
void clusterUpdateReachableNodes(void) {
    dictIterator *di;
    dictEntry *de;
    int maxsize = dictSize(server.cluster->nodes) * sizeof(clusterNode*);

    server.cluster->reachable_nodes =
        zrealloc(server.cluster->reachable_nodes,maxsize);
    server.cluster->reachable_nodes_count = 0;
    server.cluster->failing_nodes_count = 0;

    di = dictGetIterator(server.cluster->nodes);
    while((de = dictNext(di)) != NULL) {
        clusterNode *node = dictGetVal(de);

        if (node->flags & (CLUSTER_NODE_PFAIL|
                           CLUSTER_NODE_FAIL)) server.cluster->failing_nodes_count++;

        if (node->flags & (CLUSTER_NODE_MYSELF|
                           CLUSTER_NODE_HANDSHAKE|
                           CLUSTER_NODE_PFAIL|
                           CLUSTER_NODE_FAIL)) continue;
        server.cluster->reachable_nodes[server.cluster->reachable_nodes_count++]
            = node;
    }
    dictReleaseIterator(di);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x429bb(%rip), %r14     # 0x6f088
movq 0x668(%r14), %rax
movq 0x10(%rax), %rcx
movq 0x30(%rax), %rdi
movl 0x48(%rcx), %eax
addl 0x28(%rcx), %eax
shll $0x3, %eax
movslq %eax, %rsi
callq 0x1ff61
movq 0x668(%r14), %rcx
movq %rax, 0x30(%rcx)
movq $0x0, 0x38(%rcx)
movq 0x10(%rcx), %rdi
callq 0x19242
movq %rax, %rbx
movq %rax, %rdi
callq 0x1929d
testq %rax, %rax
je 0x2c752
movq 0x8(%rax), %rax
movl 0x30(%rax), %ecx
testb $0x3, %cl
je 0x2c72f
movq 0x668(%r14), %rdx
incl 0x3c(%rdx)
testb $0xf, %cl
jne 0x2c74d
movq 0x668(%r14), %rcx
movq 0x30(%rcx), %rdx
movslq 0x38(%rcx), %rsi
leal 0x1(%rsi), %edi
movl %edi, 0x38(%rcx)
movq %rax, (%rdx,%rsi,8)
movq %rbx, %rdi
jmp 0x2c70f
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1935a
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterReset
void clusterReset(int hard) {
    dictIterator *di;
    dictEntry *de;

    /* Forget all the nodes, but myself. */
    di = dictGetSafeIterator(server.cluster->nodes);
    while((de = dictNext(di)) != NULL) {
        clusterNode *node = dictGetVal(de);

        if (node == myself) continue;
        clusterDelNode(node);
    }
    dictReleaseIterator(di);

    /* Information about reachable nodes is no longer valid. Update it. */
    clusterUpdateReachableNodes();

    /* Hard reset only: change node ID. */
    if (hard) {
        sds oldname;

        /* To change the Node ID we need to remove the old name from the
         * nodes table, change the ID, and re-add back with new name. */
        oldname = sdsnewlen(myself->name, CLUSTER_NAMELEN);
        dictDelete(server.cluster->nodes,oldname);
        sdsfree(oldname);
        getRandomHexChars(myself->name, CLUSTER_NAMELEN);
        clusterAddNode(myself);
    }

    flushServerData();

    /* Make sure to persist the new config and update the state. */
    clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
                         CLUSTER_TODO_UPDATE_STATE|
                         CLUSTER_TODO_FSYNC_CONFIG);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0x42919(%rip), %r15     # 0x6f088
movq 0x668(%r15), %rax
movq 0x10(%rax), %rdi
callq 0x1926c
movq %rax, %r14
movq %rax, %rdi
callq 0x1929d
testq %rax, %rax
je 0x2c7a6
movq 0x8(%rax), %rdi
cmpq 0x56e06(%rip), %rdi     # 0x835a0
je 0x2c7a1
callq 0x2c827
movq %r14, %rdi
jmp 0x2c785
movq %r14, %rdi
callq 0x1935a
callq 0x2c6c2
testl %ebx, %ebx
je 0x2c811
movq 0x56de2(%rip), %rdi     # 0x835a0
movl $0x28, %esi
callq 0x1dd2c
movq %rax, %rbx
movq 0x668(%r15), %rax
movq 0x10(%rax), %rdi
movq %rbx, %rsi
callq 0x18e09
movq %rbx, %rdi
callq 0x1ded3
movq 0x56db3(%rip), %rdi     # 0x835a0
movl $0x28, %esi
callq 0x25612
movq 0x56da2(%rip), %rdx     # 0x835a0
movq 0x668(%r15), %rax
movq 0x10(%rax), %rdi
movq %rdx, %rsi
callq 0x18b97
callq 0x1a646
movq 0x668(%r15), %rax
orl $0x7, 0x28(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterDelNode
void clusterDelNode(clusterNode *delnode) {
    dictIterator *di;
    dictEntry *de;

    /* 1) Remove failure reports. */
    di = dictGetSafeIterator(server.cluster->nodes);
    while((de = dictNext(di)) != NULL) {
        clusterNode *node = dictGetVal(de);

        if (node == delnode) continue;
        clusterNodeDelFailureReport(node,delnode);
    }
    dictReleaseIterator(di);

    /* 2) Free the node, unlinking it from the cluster. */
    freeClusterNode(delnode);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x42853(%rip), %rax     # 0x6f088
movq 0x668(%rax), %rax
movq 0x10(%rax), %rdi
callq 0x1926c
movq %rax, %r14
movq %rax, %rdi
callq 0x1929d
testq %rax, %rax
je 0x2c86b
movq 0x8(%rax), %rdi
cmpq %rbx, %rdi
je 0x2c866
movq %rbx, %rsi
callq 0x2cbc0
movq %r14, %rdi
jmp 0x2c84b
movq %r14, %rdi
callq 0x1935a
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2cc3b
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: createClusterLink
clusterLink *createClusterLink(clusterNode *node) {
    clusterLink *link = zmalloc(sizeof(*link));
    link->ctime = mstime();
    link->sndbuf = sdsempty();
    link->rcvbuf = sdsempty();
    link->node = node;
    link->fd = -1;
    return link;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x28, %edi
callq 0x1fea5
movq %rax, %r14
callq 0x1a1d3
movq %rax, (%r14)
callq 0x1de3f
movq %rax, 0x10(%r14)
callq 0x1de3f
movq %rax, 0x18(%r14)
movq %rbx, 0x20(%r14)
movl $0xffffffff, 0x8(%r14)  # imm = 0xFFFFFFFF
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: freeClusterLink
void freeClusterLink(clusterLink *link) {
    if (link->fd != -1) {
        aeDeleteFileEvent(server.el, link->fd, AE_WRITABLE);
        aeDeleteFileEvent(server.el, link->fd, AE_READABLE);
    }
    sdsfree(link->sndbuf);
    sdsfree(link->rcvbuf);
    if (link->node)
        link->node->link = NULL;
    close(link->fd);
    zfree(link);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x8(%rdi), %esi
cmpl $-0x1, %esi
je 0x2c90e
leaq 0x42799(%rip), %r14     # 0x6f088
movq 0x38(%r14), %rdi
movl $0x2, %edx
callq 0x1713d
movq 0x38(%r14), %rdi
movl 0x8(%rbx), %esi
movl $0x1, %edx
callq 0x1713d
movq 0x10(%rbx), %rdi
callq 0x1ded3
movq 0x18(%rbx), %rdi
callq 0x1ded3
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x2c934
movq $0x0, 0x88(%rax)
movl 0x8(%rbx), %edi
callq 0x123b0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1ffff
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterNodeAddFailureReport
int clusterNodeAddFailureReport(clusterNode *failing, clusterNode *sender) {
    list *l = failing->fail_reports;
    listNode *ln;
    listIter li;
    clusterNodeFailReport *fr;

    /* If a failure report from the same sender already exists, just update
     * the timestamp. */
    listRewind(l,&li);
    while ((ln = listNext(&li)) != NULL) {
        fr = ln->value;
        if (fr->node == sender) {
            fr->time = mstime();
            return 0;
        }
    }

    /* Otherwise create a new report. */
    fr = zmalloc(sizeof(*fr));
    fr->node = sender;
    fr->time = mstime();
    listAddNodeTail(l,fr);
    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq 0x90(%rdi), %rbx
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x16c72
movq %r15, %rdi
callq 0x16c8f
testq %rax, %rax
je 0x2cb0a
movq 0x10(%rax), %r12
cmpq %r14, (%r12)
jne 0x2cae5
callq 0x1a1d3
movq %rax, 0x8(%r12)
xorl %eax, %eax
jmp 0x2cb33
movl $0x10, %edi
callq 0x1fea5
movq %rax, %r15
movq %r14, (%rax)
callq 0x1a1d3
movq %rax, 0x8(%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x16aff
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterNodeCleanupFailureReports
void clusterNodeCleanupFailureReports(clusterNode *node) {
    list *l = node->fail_reports;
    listNode *ln;
    listIter li;
    clusterNodeFailReport *fr;
    mstime_t maxtime = server.cluster_node_timeout *
                     CLUSTER_FAIL_REPORT_VALIDITY_MULT;
    mstime_t now = mstime();

    listRewind(l,&li);
    while ((ln = listNext(&li)) != NULL) {
        fr = ln->value;
        if (now - fr->time > maxtime) listDelNode(l,ln);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x90(%rdi), %rbx
leaq 0x42530(%rip), %rax     # 0x6f088
movq 0x658(%rax), %r12
callq 0x1a1d3
movq %rax, %r14
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x16c72
movq %r15, %rdi
callq 0x16c8f
testq %rax, %rax
je 0x2cbb4
addq %r12, %r12
leaq 0x8(%rsp), %r15
movq 0x10(%rax), %rcx
movq %r14, %rdx
subq 0x8(%rcx), %rdx
cmpq %r12, %rdx
jle 0x2cba7
movq %rbx, %rdi
movq %rax, %rsi
callq 0x16be4
movq %r15, %rdi
callq 0x16c8f
testq %rax, %rax
jne 0x2cb8c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterNodeDelFailureReport
int clusterNodeDelFailureReport(clusterNode *node, clusterNode *sender) {
    list *l = node->fail_reports;
    listNode *ln;
    listIter li;
    clusterNodeFailReport *fr;

    /* Search for a failure report from this sender. */
    listRewind(l,&li);
    while ((ln = listNext(&li)) != NULL) {
        fr = ln->value;
        if (fr->node == sender) break;
    }
    if (!ln) return 0; /* No failure report from this sender. */

    /* Remove the failure report. */
    listDelNode(l,ln);
    clusterNodeCleanupFailureReports(node);
    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x90(%rdi), %r14
leaq 0x8(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x16c72
movq %r12, %rdi
callq 0x16c8f
testq %rax, %rax
je 0x2cc18
movq 0x10(%rax), %rcx
cmpq %r15, (%rcx)
jne 0x2cbe8
movq %r14, %rdi
movq %rax, %rsi
callq 0x16be4
movq %rbx, %rdi
callq 0x2cb3f
movl $0x1, %eax
jmp 0x2cc1a
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: freeClusterNode
void freeClusterNode(clusterNode *n) {
    serverAssert(dictDelete(server.cluster->nodes,n->name) == DICT_OK);
    if (n->link) freeClusterLink(n->link);
    /* We can free nodes in handshake state, but we can't free nodes
     * that were part of the cluster: they may still be referenced
     * by jobs. */
    if (nodeInHandshake(n)) {
        listRelease(n->fail_reports);
        zfree(n);
    } else {
        dictAdd(server.cluster->deleted_nodes,n->name,n);
        n->flags |= CLUSTER_NODE_DELETED;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4243f(%rip), %r14     # 0x6f088
movq 0x668(%r14), %rax
movq 0x10(%rax), %rdi
movq %rbx, %rsi
callq 0x18e09
testl %eax, %eax
jne 0x2ccb4
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0x2cc71
callq 0x2c8d9
testb $0x8, 0x30(%rbx)
jne 0x2cc99
movq 0x668(%r14), %rax
movq 0x18(%rax), %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x18b97
orb $0x40, 0x30(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x90(%rbx), %rdi
callq 0x16a50
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1ffff
leaq 0x2a0ff(%rip), %rdi     # 0x56dba
leaq 0x29de3(%rip), %rsi     # 0x56aa5
movl $0x27f, %edx            # imm = 0x27F
callq 0x2a9ff
movl $0x1, %edi
callq 0x12120
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterRenameNode
void clusterRenameNode(clusterNode *node, char *newname) {
    int retval;
    sds s = sdsnewlen(node->name, CLUSTER_NAMELEN);

    serverLog(LL_DEBUG,"Renaming node %.40s into %.40s",
        node->name, newname);
    retval = dictDelete(server.cluster->nodes, s);
    sdsfree(s);
    serverAssert(retval == DICT_OK);
    memcpy(node->name, newname, CLUSTER_NAMELEN);
    clusterAddNode(node);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl $0x28, %esi
callq 0x1dd2c
movq %rax, %r15
leaq 0x2a0f7(%rip), %rsi     # 0x56def
xorl %edi, %edi
movq %rbx, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x19fb1
leaq 0x4237a(%rip), %r12     # 0x6f088
movq 0x668(%r12), %rax
movq 0x10(%rax), %rdi
movq %r15, %rsi
callq 0x18e09
movl %eax, %ebp
movq %r15, %rdi
callq 0x1ded3
testl %ebp, %ebp
jne 0x2cd67
movq 0x20(%r14), %rax
movq %rax, 0x20(%rbx)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
movq 0x668(%r12), %rax
movq 0x10(%rax), %rdi
movq %rbx, %rsi
movq %rbx, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x18b97
leaq 0x28ba4(%rip), %rdi     # 0x55912
leaq 0x29d30(%rip), %rsi     # 0x56aa5
movl $0x2be, %edx            # imm = 0x2BE
callq 0x2a9ff
movl $0x1, %edi
callq 0x12120
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterBlacklistCleanup
void clusterBlacklistCleanup(void) {
    dictIterator *di;
    dictEntry *de;

    di = dictGetSafeIterator(server.cluster->nodes_black_list);
    while((de = dictNext(di)) != NULL) {
        int64_t expire = dictGetUnsignedIntegerVal(de);

        if (expire < server.unixtime)
            dictDelete(server.cluster->nodes_black_list,dictGetKey(de));
    }
    dictReleaseIterator(di);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x422f4(%rip), %r14     # 0x6f088
movq 0x668(%r14), %rax
movq 0x20(%rax), %rdi
callq 0x1926c
movq %rax, %rbx
movq %rax, %rdi
callq 0x1929d
testq %rax, %rax
je 0x2cdd9
movq 0x8(%rax), %rcx
cmpq 0x648(%r14), %rcx
jge 0x2cdd4
movq 0x668(%r14), %rcx
movq 0x20(%rcx), %rdi
movq (%rax), %rsi
callq 0x18e09
movq %rbx, %rdi
jmp 0x2cdaa
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1935a
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterBlacklistAddNode
void clusterBlacklistAddNode(clusterNode *node) {
    dictEntry *de;
    sds id = sdsnewlen(node->name,CLUSTER_NAMELEN);

    clusterBlacklistCleanup();
    if (dictAdd(server.cluster->nodes_black_list,id,NULL) == DICT_OK) {
        /* If the key was added, duplicate the sds string representation of
         * the key for the next lookup. We'll free it at the end. */
        id = sdsdup(id);
    }
    de = dictFind(server.cluster->nodes_black_list,id);
    dictSetUnsignedIntegerVal(de,time(NULL)+DISCNT_CLUSTER_BLACKLIST_TTL);
    sdsfree(id);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x28, %esi
callq 0x1dd2c
movq %rax, %rbx
callq 0x2cd89
leaq 0x42283(%rip), %r14     # 0x6f088
movq 0x668(%r14), %rax
movq 0x20(%rax), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x18b97
testl %eax, %eax
jne 0x2ce29
movq %rbx, %rdi
callq 0x1de83
movq %rax, %rbx
movq 0x668(%r14), %rax
movq 0x20(%rax), %rdi
movq %rbx, %rsi
callq 0x190de
movq %rax, %r14
xorl %edi, %edi
callq 0x12550
addq $0x3c, %rax
movq %rax, 0x8(%r14)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1ded3
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterBlacklistExists
int clusterBlacklistExists(char *nodeid) {
    sds id = sdsnewlen(nodeid,CLUSTER_NAMELEN);
    int retval;

    clusterBlacklistCleanup();
    retval = dictFind(server.cluster->nodes_black_list,id) != NULL;
    sdsfree(id);
    return retval;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl $0x28, %esi
callq 0x1dd2c
movq %rax, %rbx
callq 0x2cd89
leaq 0x4220f(%rip), %rax     # 0x6f088
movq 0x668(%rax), %rax
movq 0x20(%rax), %rdi
movq %rbx, %rsi
callq 0x190de
xorl %ebp, %ebp
testq %rax, %rax
setne %bpl
movq %rbx, %rdi
callq 0x1ded3
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: markNodeAsFailingIfNeeded
void markNodeAsFailingIfNeeded(clusterNode *node) {
    int failures;
    int needed_quorum = (server.cluster->size / 2) + 1;

    if (!nodeTimedOut(node)) return; /* We can reach it. */
    if (nodeFailed(node)) return; /* Already FAILing. */

    failures = clusterNodeFailureReportsCount(node);
    /* Also count myself as a voter if I'm a master. */
    failures++;
    if (failures < needed_quorum) return; /* No weak agreement from masters. */

    serverLog(LL_VERBOSE,
        "Marking node %.40s as failing (quorum reached).", node->name);

    /* Mark the node as failing. */
    node->flags &= ~CLUSTER_NODE_PFAIL;
    node->flags |= CLUSTER_NODE_FAIL;
    node->fail_time = mstime();

    /* Broadcast the failing node name to everybody, forcing all the other
     * reachable nodes to flag the node as FAIL. */
    clusterSendFail(node->name);
    clusterDoBeforeSleep(CLUSTER_TODO_UPDATE_STATE|CLUSTER_TODO_SAVE_CONFIG);
}

// Assembly:
movl 0x30(%rdi), %eax
andl $0x3, %eax
cmpl $0x1, %eax
jne 0x2cf25
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x421c9(%rip), %r14     # 0x6f088
movq 0x668(%r14), %rax
movl 0xc(%rax), %eax
movl %eax, %ebp
shrl $0x1f, %ebp
addl %eax, %ebp
sarl %ebp
callq 0x2cb3f
movq 0x90(%rbx), %rax
cmpl 0x28(%rax), %ebp
jg 0x2cf21
leaq 0x29f24(%rip), %rsi     # 0x56e0e
movl $0x1, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x19fb1
movl 0x30(%rbx), %eax
andl $-0x4, %eax
orl $0x2, %eax
movl %eax, 0x30(%rbx)
callq 0x1a1d3
movq %rax, 0x48(%rbx)
movq %rbx, %rdi
callq 0x2cf26
movq 0x668(%r14), %rax
orl $0x3, 0x28(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterSendFail
void clusterSendFail(char *nodename) {
    unsigned char buf[sizeof(clusterMsg)];
    clusterMsg *hdr = (clusterMsg*) buf;

    clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_FAIL);
    memcpy(hdr->data.fail.about.nodename,nodename,CLUSTER_NAMELEN);
    clusterBroadcastMessage(server.cluster->nodes,buf,ntohl(hdr->totlen));
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %r14
movq %rsp, %rbx
movl $0xc8, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x12380
movl $0x5a756244, (%rbx)     # imm = 0x5A756244
movw $0x300, 0xc(%rbx)       # imm = 0x300
movq 0x56648(%rip), %rax     # 0x835a0
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movaps %xmm0, 0x10(%rbx)
movaps %xmm1, 0x20(%rbx)
movq 0x20(%rax), %rcx
movq %rcx, 0x30(%rbx)
leaq 0x42112(%rip), %rcx     # 0x6f088
movzwl 0xb4(%rcx), %edx
rolw $0x8, %dx
movw %dx, 0x58(%rbx)
movzwl 0x30(%rax), %eax
rolw $0x8, %ax
movw %ax, 0x5a(%rbx)
movq 0x668(%rcx), %rax
movb 0x8(%rax), %cl
movb %cl, 0x5c(%rbx)
movl $0x88000000, 0x4(%rbx)  # imm = 0x88000000
movups (%r14), %xmm0
movaps %xmm0, 0x60(%rbx)
movups 0x10(%r14), %xmm0
movaps %xmm0, 0x70(%rbx)
movq 0x20(%r14), %rcx
movq %rcx, 0x80(%rbx)
movq 0x10(%rax), %rdi
movl $0x88, %edx
movq %rbx, %rsi
callq 0x2df65
addq $0xc8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clearNodeFailureIfNeeded
void clearNodeFailureIfNeeded(clusterNode *node) {
    serverAssert(nodeFailed(node));

    /* We always clear the FAIL flag if we can contact the node again. */
    serverLog(LL_VERBOSE,
        "Clear FAIL state for node %.40s: it is reachable again.",
            node->name);
    node->flags &= ~CLUSTER_NODE_FAIL;
    clusterDoBeforeSleep(CLUSTER_TODO_UPDATE_STATE|CLUSTER_TODO_SAVE_CONFIG);
}

// Assembly:
pushq %rbx
testb $0x2, 0x30(%rdi)
je 0x2d015
movq %rdi, %rbx
leaq 0x29e61(%rip), %rsi     # 0x56e4f
movl $0x1, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x19fb1
andb $-0x3, 0x30(%rbx)
leaq 0x42080(%rip), %rax     # 0x6f088
movq 0x668(%rax), %rax
orl $0x3, 0x28(%rax)
popq %rbx
retq
leaq 0x29e22(%rip), %rdi     # 0x56e3e
leaq 0x29a82(%rip), %rsi     # 0x56aa5
movl $0x344, %edx            # imm = 0x344
callq 0x2a9ff
movl $0x1, %edi
callq 0x12120