LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/erikdubbelboer[P]discnt/src/networking.c
// Function: freeClient
void freeClient(client *c) {
    listNode *ln;

    /* Free the query buffer */
    sdsfree(c->querybuf);
    c->querybuf = NULL;

    /* Deallocate structures used to block on blocking ops. */
    if (c->flags & CLIENT_BLOCKED) unblockClient(c);

    if (c->sub_counters != NULL) {
      pubsubUnsubscribeAllCounters(c,0);
      dictRelease(c->sub_counters);
      c->sub_counters = NULL;
    }

    /* Free data structures. */
    listRelease(c->reply);
    freeClientArgv(c);

    /* Unlink the client: this will close the socket, remove the I/O
     * handlers, and remove references of the client from different
     * places where active clients may be referenced. */
    unlinkClient(c);

    if (c->flags & CLIENT_MONITOR) {
        ln = listSearchKey(server.monitors,c);
        serverAssert(ln != NULL);
        listDelNode(server.monitors,ln);
    }

    /* If this client was scheduled for async freeing we need to remove it
     * from the queue. */
    if (c->flags & CLIENT_CLOSE_ASAP) {
        ln = listSearchKey(server.clients_to_close,c);
        serverAssert(ln != NULL);
        listDelNode(server.clients_to_close,ln);
    }

    /* Release other dynamically allocated client structure fields,
     * and finally release the client structure itself. */
    if (c->name) decrRefCount(c->name);
    zfree(c->argv);
    sdsfree(c->peerid);
    zfree(c);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x1dc25
movq $0x0, 0x18(%rbx)
testb $0x10, 0x88(%rbx)
je 0x22c2f
movq %rbx, %rdi
callq 0x2fd04
cmpq $0x0, 0xa8(%rbx)
je 0x22c5a
movq %rbx, %rdi
xorl %esi, %esi
callq 0x33deb
movq 0xa8(%rbx), %rdi
callq 0x18d18
movq $0x0, 0xa8(%rbx)
movq 0x58(%rbx), %rdi
callq 0x164fc
movq %rbx, %rdi
callq 0x22d46
movq %rbx, %rdi
callq 0x22ac4
movl 0x88(%rbx), %eax
testb $0x4, %al
je 0x22cad
leaq 0x4c404(%rip), %r14     # 0x6f088
movq 0x1f8(%r14), %rdi
movq %rbx, %rsi
callq 0x16809
testq %rax, %rax
je 0x22d0f
movq 0x1f8(%r14), %rdi
movq %rax, %rsi
callq 0x16691
movl 0x88(%rbx), %eax
btl $0xa, %eax
jae 0x22cdd
leaq 0x4c3ce(%rip), %r14     # 0x6f088
movq 0x1e8(%r14), %rdi
movq %rbx, %rsi
callq 0x16809
testq %rax, %rax
je 0x22d24
movq 0x1e8(%r14), %rdi
movq %rax, %rsi
callq 0x16691
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x22ceb
callq 0x25945
movq 0x30(%rbx), %rdi
callq 0x1fd17
movq 0xb0(%rbx), %rdi
callq 0x1dc25
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1fd17
leaq 0x31fb8(%rip), %rdi     # 0x54cce
leaq 0x31f09(%rip), %rsi     # 0x54c26
movl $0x2c8, %edx            # imm = 0x2C8
jmp 0x22d37
leaq 0x31fa3(%rip), %rdi     # 0x54cce
leaq 0x31ef4(%rip), %rsi     # 0x54c26
movl $0x2d0, %edx            # imm = 0x2D0
callq 0x2a46a
movl $0x1, %edi
callq 0x12120
// File: /workspace/github_c_makefile_star2_O3/erikdubbelboer[P]discnt/src/networking.c
// Function: getAllClientsInfoString
sds getAllClientsInfoString(void) {
    listNode *ln;
    listIter li;
    client *client;
    sds o = sdsempty();

    o = sdsMakeRoomFor(o,200*listLength(server.clients));
    listRewind(server.clients,&li);
    while ((ln = listNext(&li)) != NULL) {
        client = listNodeValue(ln);
        o = catClientInfoString(o,client);
        o = sdscatlen(o,"\n",1);
    }
    return o;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
callq 0x1db82
leaq 0x4b11c(%rip), %r14     # 0x6f088
movq 0x1e0(%r14), %rcx
imulq $0xc8, 0x28(%rcx), %rsi
movq %rax, %rdi
callq 0x1dcd7
movq %rax, %rbx
movq 0x1e0(%r14), %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x16717
movq %r14, %rdi
callq 0x16734
testq %rax, %rax
je 0x23fdb
leaq 0x2fe2c(%rip), %r14     # 0x53dd8
movq %rsp, %r15
movq 0x10(%rax), %rsi
movq %rbx, %rdi
callq 0x23af0
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x1e3ca
movq %rax, %rbx
movq %r15, %rdi
callq 0x16734
testq %rax, %rax
jne 0x23faf
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/erikdubbelboer[P]discnt/src/networking.c
// Function: rewriteClientCommandArgument
void rewriteClientCommandArgument(client *c, int i, robj *newval) {
    robj *oldval;

    serverAssertWithInfo(c,NULL,i < c->argc);
    oldval = c->argv[i];
    c->argv[i] = newval;
    incrRefCount(newval);
    decrRefCount(oldval);

    /* If this is the command name make sure to fix c->cmd. */
    if (i == 0) {
        c->cmd = lookupCommandOrOriginal(c->argv[0]->ptr);
        serverAssertWithInfo(c,NULL,c->cmd != NULL);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl %esi, 0x28(%rdi)
jle 0x248f3
movq 0x30(%rbx), %rax
movslq %esi, %r15
movq (%rax,%r15,8), %r14
movq %rdx, (%rax,%r15,8)
movq %rdx, %rdi
callq 0x2577e
movq %r14, %rdi
callq 0x25945
testl %r15d, %r15d
jne 0x248ed
movq 0x30(%rbx), %rax
movq (%rax), %rax
movq 0x8(%rax), %rdi
callq 0x1bc55
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0x2490e
popq %rbx
popq %r14
popq %r15
retq
leaq 0x30774(%rip), %rdx     # 0x5506e
leaq 0x30325(%rip), %rcx     # 0x54c26
movq %rbx, %rdi
xorl %esi, %esi
movl $0x5eb, %r8d            # imm = 0x5EB
jmp 0x24927
leaq 0x3074a(%rip), %rdx     # 0x5505f
leaq 0x3030a(%rip), %rcx     # 0x54c26
movq %rbx, %rdi
xorl %esi, %esi
movl $0x5f4, %r8d            # imm = 0x5F4
callq 0x2a427
movl $0x1, %edi
callq 0x12120
// File: /workspace/github_c_makefile_star2_O3/erikdubbelboer[P]discnt/src/networking.c
// Function: checkClientOutputBufferLimits
int checkClientOutputBufferLimits(client *c) {
    int soft = 0, hard = 0, class;
    unsigned long used_mem = getClientOutputBufferMemoryUsage(c);

    class = getClientType(c);
    if (server.client_obuf_limits[class].hard_limit_bytes &&
        used_mem >= server.client_obuf_limits[class].hard_limit_bytes)
        hard = 1;
    if (server.client_obuf_limits[class].soft_limit_bytes &&
        used_mem >= server.client_obuf_limits[class].soft_limit_bytes)
        soft = 1;

    /* We need to check if the soft limit is reached continuously for the
     * specified amount of seconds. */
    if (soft) {
        if (c->obuf_soft_limit_reached_time == 0) {
            c->obuf_soft_limit_reached_time = server.unixtime;
            soft = 0; /* First time we see the soft limit reached */
        } else {
            time_t elapsed = server.unixtime - c->obuf_soft_limit_reached_time;

            if (elapsed <=
                server.client_obuf_limits[class].soft_limit_seconds) {
                soft = 0; /* The client still did not reached the max number of
                             seconds for the soft limit to be considered
                             reached. */
            }
        }
    } else {
        c->obuf_soft_limit_reached_time = 0;
    }
    return soft || hard;
}

// Assembly:
movq 0x58(%rdi), %rax
movq 0x28(%rax), %rax
leaq (%rax,%rax,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %rax, %rax
addq %rcx, %rax
addq 0x60(%rdi), %rax
movl 0x88(%rdi), %ecx
shrl $0x12, %ecx
andl $0x1, %ecx
leaq (%rcx,%rcx,2), %rdx
leaq 0x4a703(%rip), %rsi     # 0x6f088
movq 0x5c0(%rsi,%rdx,8), %rcx
movq 0x5c8(%rsi,%rdx,8), %r8
decq %r8
cmpq %rax, %r8
jae 0x249c7
movq 0x80(%rdi), %r9
movq 0x648(%rsi), %r8
testq %r9, %r9
je 0x249d4
leaq (%rsi,%rdx,8), %rdx
addq $0x5c0, %rdx            # imm = 0x5C0
subq %r9, %r8
cmpq 0x10(%rdx), %r8
setg %dl
jmp 0x249dd
movq $0x0, 0x80(%rdi)
jmp 0x249db
movq %r8, 0x80(%rdi)
xorl %edx, %edx
decq %rcx
cmpq %rax, %rcx
setb %al
orb %dl, %al
movzbl %al, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/erikdubbelboer[P]discnt/src/util.c
// Function: memtoll
long long memtoll(const char *p, int *err) {
    const char *u;
    char buf[128];
    long mul; /* unit multiplier */
    long long val;
    unsigned int digits;

    if (err) *err = 0;
    /* Search the first non digit character. */
    u = p;
    if (*u == '-') u++;
    while(*u && isdigit(*u)) u++;
    if (*u == '\0' || !strcasecmp(u,"b")) {
        mul = 1;
    } else if (!strcasecmp(u,"k")) {
        mul = 1000;
    } else if (!strcasecmp(u,"kb")) {
        mul = 1024;
    } else if (!strcasecmp(u,"m")) {
        mul = 1000*1000;
    } else if (!strcasecmp(u,"mb")) {
        mul = 1024*1024;
    } else if (!strcasecmp(u,"g")) {
        mul = 1000L*1000*1000;
    } else if (!strcasecmp(u,"gb")) {
        mul = 1024L*1024*1024;
    } else {
        if (err) *err = 1;
        mul = 1;
    }
    digits = u-p;
    if (digits >= sizeof(buf)) {
        if (err) *err = 1;
        return LLONG_MAX;
    }
    memcpy(buf,p,digits);
    buf[digits] = '\0';
    val = strtoll(buf,NULL,10);
    return val*mul;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0x24d18
movl $0x0, (%rbx)
xorl %eax, %eax
cmpb $0x2d, (%r14)
sete %al
leaq (%r14,%rax), %r15
movb (%r14,%rax), %bpl
movl $0x1, %r12d
testb %bpl, %bpl
je 0x24e33
callq 0x129a0
movq (%rax), %rax
movsbq %bpl, %rcx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x24d5c
movb 0x1(%r15), %bpl
incq %r15
testb %bpl, %bpl
jne 0x24d40
jmp 0x24e33
leaq 0x2fae3(%rip), %rsi     # 0x54846
movq %r15, %rdi
callq 0x12090
testl %eax, %eax
je 0x24e33
leaq 0x3564b(%rip), %rsi     # 0x5a3c5
movq %r15, %rdi
callq 0x12090
testl %eax, %eax
je 0x24e0d
leaq 0x3107e(%rip), %rsi     # 0x55e0f
movq %r15, %rdi
callq 0x12090
testl %eax, %eax
je 0x24e15
leaq 0x33a60(%rip), %rsi     # 0x58804
movq %r15, %rdi
callq 0x12090
testl %eax, %eax
je 0x24e1d
leaq 0x31051(%rip), %rsi     # 0x55e08
movq %r15, %rdi
callq 0x12090
testl %eax, %eax
je 0x24e25
leaq 0x2fea2(%rip), %rsi     # 0x54c6c
movq %r15, %rdi
callq 0x12090
testl %eax, %eax
je 0x24e2d
leaq 0x31024(%rip), %rsi     # 0x55e01
movq %r15, %rdi
callq 0x12090
testl %eax, %eax
movl $0x40000000, %ecx       # imm = 0x40000000
movl $0x1, %r12d
cmoveq %rcx, %r12
testq %rbx, %rbx
je 0x24e33
testl %eax, %eax
je 0x24e33
movl $0x1, (%rbx)
movl $0x1, %r12d
jmp 0x24e33
movl $0x3e8, %r12d           # imm = 0x3E8
jmp 0x24e33
movl $0x400, %r12d           # imm = 0x400
jmp 0x24e33
movl $0xf4240, %r12d         # imm = 0xF4240
jmp 0x24e33
movl $0x100000, %r12d        # imm = 0x100000
jmp 0x24e33
movl $0x3b9aca00, %r12d      # imm = 0x3B9ACA00
subl %r14d, %r15d
cmpl $0x80, %r15d
jb 0x24e56
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
testq %rbx, %rbx
je 0x24e7f
movl $0x1, (%rbx)
jmp 0x24e7f
movq %rsp, %rbx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x12510
movb $0x0, (%rsp,%r15)
movq %rbx, %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x124b0
imulq %r12, %rax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/erikdubbelboer[P]discnt/src/object.c
// Function: createObject
robj *createObject(int type, void *ptr) {
    robj *o = zmalloc(sizeof(*o));
    o->type = type;
    o->encoding = OBJ_ENCODING_RAW;
    o->ptr = ptr;
    o->refcount = 1;
    o->notused = 0;
    return o;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
movl $0x10, %edi
callq 0x1fbbd
andl $0xf, %ebp
movq %rbx, 0x8(%rax)
movl $0x1, 0x4(%rax)
movl %ebp, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/erikdubbelboer[P]discnt/src/object.c
// Function: createStringObject
robj *createStringObject(const char *ptr, size_t len) {
    if (len <= OBJ_ENCODING_EMBSTR_SIZE_LIMIT)
        return createEmbeddedStringObject(ptr,len);
    else
        return createRawStringObject(ptr,len);
}

// Assembly:
cmpq $0x2c, %rsi
jbe 0x2569b
pushq %rbx
callq 0x1da70
movq %rax, %rbx
movl $0x10, %edi
callq 0x1fbbd
movq %rbx, 0x8(%rax)
movabsq $0x100000000, %rcx      # imm = 0x100000000
movq %rcx, (%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/erikdubbelboer[P]discnt/src/object.c
// Function: createStringObjectFromLongDouble
robj *createStringObjectFromLongDouble(long double value) {
    char buf[256];
    int len;

    /* We use 17 digits precision since with 128 bit floats that precision
     * after rounding is able to represent most small decimal numbers in a way
     * that is "non surprising" for the user (that is, most small decimal
     * numbers will be represented in a way that when converted back into
     * a string are exactly the same as what the user typed.) */
    len = snprintf(buf,sizeof(buf),"%.17Lf", value);
    /* Now remove trailing zeroes after the '.' */
    if (strchr(buf,'.') != NULL) {
        char *p = buf+len-1;
        while(*p == '0') {
            p--;
            len--;
        }
        if (*p == '.') len--;
    }
    return createStringObject(buf,len);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
fldt 0x130(%rsp)
fstpt (%rsp)
leaq 0x2fc0b(%rip), %rdx     # 0x553a8
leaq 0x10(%rsp), %r14
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdi
xorl %eax, %eax
callq 0x122d0
movl %eax, %ebx
movq %r14, %rdi
movl $0x2e, %esi
callq 0x122b0
testq %rax, %rax
je 0x257de
movslq %ebx, %rbx
movzbl 0xf(%rsp,%rbx), %eax
cmpl $0x30, %eax
jne 0x257d7
decq %rbx
jmp 0x257c8
cmpl $0x2e, %eax
jne 0x257de
decl %ebx
movslq %ebx, %rsi
leaq 0x10(%rsp), %rdi
callq 0x25710
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/erikdubbelboer[P]discnt/src/object.c
// Function: decrRefCount
void decrRefCount(robj *o) {
    if (o->refcount <= 0) serverPanic("decrRefCount against refcount <= 0");
    if (o->refcount == 1) {
        switch(o->type) {
        case OBJ_STRING: freeStringObject(o); break;
        default: serverPanic("Unknown object type"); break;
        }
        zfree(o);
    } else {
        o->refcount--;
    }
}

// Assembly:
pushq %rbx
movl 0x4(%rdi), %eax
testl %eax, %eax
jle 0x25978
movq %rdi, %rbx
cmpl $0x1, %eax
jne 0x25971
movl (%rbx), %eax
testb $0xf, %al
jne 0x2598d
testb $-0x10, %al
jne 0x25968
movq 0x8(%rbx), %rdi
callq 0x1dc25
movq %rbx, %rdi
popq %rbx
jmp 0x1fd17
decl %eax
movl %eax, 0x4(%rbx)
popq %rbx
retq
leaq 0x2fa4b(%rip), %rdi     # 0x553ca
leaq 0x2fa29(%rip), %rsi     # 0x553af
movl $0xb0, %edx
jmp 0x259a0
leaq 0x2fa5b(%rip), %rdi     # 0x553ef
leaq 0x2fa14(%rip), %rsi     # 0x553af
movl $0xb4, %edx
callq 0x2a81d
movl $0x1, %edi
callq 0x12120
// File: /workspace/github_c_makefile_star2_O3/erikdubbelboer[P]discnt/src/object.c
// Function: getLongLongFromObject
int getLongLongFromObject(robj *o, long long *target) {
    long long value;
    char *eptr;

    if (o == NULL) {
        value = 0;
    } else {
        serverAssertWithInfo(NULL,o,o->type == OBJ_STRING);
        if (sdsEncodedObject(o)) {
            errno = 0;
            value = strtoll(o->ptr, &eptr, 10);
            if (isspace(((char*)o->ptr)[0]) || eptr[0] != '\0' ||
                errno == ERANGE)
                return C_ERR;
        } else if (o->encoding == OBJ_ENCODING_INT) {
            value = (long)o->ptr;
        } else {
            serverPanic("Unknown string encoding");
        }
    }
    if (target) *target = value;
    return C_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
xorl %r15d, %r15d
testq %rdi, %rdi
je 0x2629b
movq %rdi, %r14
movl (%rdi), %eax
testb $0xf, %al
jne 0x262b1
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x2, %eax
je 0x26247
cmpl $0x1, %eax
je 0x26297
testl %eax, %eax
jne 0x262d1
callq 0x120d0
movq %rax, %r12
movl $0x0, (%rax)
movq 0x8(%r14), %rdi
movq %rsp, %rsi
movl $0xa, %edx
callq 0x124b0
movq %rax, %r15
callq 0x129a0
movq (%rax), %rcx
movq 0x8(%r14), %rax
movsbq (%rax), %rdx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb $0x20, 0x1(%rcx,%rdx,2)
jne 0x262a5
movq (%rsp), %rcx
cmpb $0x0, (%rcx)
jne 0x262a5
cmpl $0x22, (%r12)
jne 0x2629b
jmp 0x262a5
movq 0x8(%r14), %r15
testq %rbx, %rbx
je 0x262a3
movq %r15, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x2e958(%rip), %rdx     # 0x54c10
leaq 0x2f0f0(%rip), %rcx     # 0x553af
xorl %edi, %edi
movq %r14, %rsi
movl $0x1e9, %r8d            # imm = 0x1E9
callq 0x2a427
jmp 0x262e9
leaq 0x2f174(%rip), %rdi     # 0x5544c
leaq 0x2f0d0(%rip), %rsi     # 0x553af
movl $0x1f3, %edx            # imm = 0x1F3
callq 0x2a81d
movl $0x1, %edi
callq 0x12120
// File: /workspace/github_c_makefile_star2_O3/erikdubbelboer[P]discnt/src/config.c
// Function: configCommand
void configCommand(client *c) {
    if (!strcasecmp(c->argv[1]->ptr,"set")) {
        if (c->argc != 4) goto badarity;
        configSetCommand(c);
    } else if (!strcasecmp(c->argv[1]->ptr,"get")) {
        if (c->argc != 3) goto badarity;
        configGetCommand(c);
    } else if (!strcasecmp(c->argv[1]->ptr,"resetstat")) {
        if (c->argc != 2) goto badarity;
        resetServerStats();
        resetCommandTableStats();
        addReply(c,shared.ok);
    } else if (!strcasecmp(c->argv[1]->ptr,"rewrite")) {
        if (c->argc != 2) goto badarity;
        if (server.configfile == NULL) {
            addReplyError(c,"The server is running without a config file");
            return;
        }
        if (rewriteConfig(server.configfile) == -1) {
            serverLog(LL_WARNING,"CONFIG REWRITE failed: %s", strerror(errno));
            addReplyErrorFormat(c,"Rewriting config file: %s", strerror(errno));
        } else {
            serverLog(LL_WARNING,"CONFIG REWRITE executed with success.");
            addReply(c,shared.ok);
        }
    } else {
        addReplyError(c,
            "CONFIG subcommand must be one of GET, SET, RESETSTAT, REWRITE");
    }
    return;

badarity:
    addReplyErrorFormat(c,"Wrong number of arguments for CONFIG %s",
        (char*) c->argv[1]->ptr);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x30(%rdi), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %r14
leaq 0x29ad9(%rip), %rsi     # 0x532ad
movq %r14, %rdi
callq 0x12090
testl %eax, %eax
je 0x2982f
leaq 0x28d5d(%rip), %rsi     # 0x52544
movq %r14, %rdi
callq 0x12090
testl %eax, %eax
je 0x29848
leaq 0x2c667(%rip), %rsi     # 0x55e61
movq %r14, %rdi
callq 0x12090
testl %eax, %eax
je 0x2985d
leaq 0x2c65e(%rip), %rsi     # 0x55e6b
movq %r14, %rdi
callq 0x12090
testl %eax, %eax
je 0x29887
leaq 0x2c6d9(%rip), %rsi     # 0x55ef9
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2200c
cmpl $0x4, 0x28(%rbx)
jne 0x298bc
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x27263
cmpl $0x3, 0x28(%rbx)
jne 0x298bc
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x27c1a
cmpl $0x2, 0x28(%rbx)
jne 0x298bc
callq 0x1b776
callq 0x1bc26
leaq 0x45f24(%rip), %rax     # 0x6f798
movq 0x8(%rax), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x21c5a
cmpl $0x2, 0x28(%rbx)
jne 0x298bc
leaq 0x457f4(%rip), %rax     # 0x6f088
movq 0x8(%rax), %rdi
testq %rdi, %rdi
je 0x298d7
callq 0x29478
cmpl $-0x1, %eax
je 0x298e3
leaq 0x2c625(%rip), %rsi     # 0x55ed3
movl $0x3, %edi
xorl %eax, %eax
callq 0x19c06
jmp 0x2986d
leaq 0x2c674(%rip), %rsi     # 0x55f37
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x22033
leaq 0x2c595(%rip), %rsi     # 0x55e73
jmp 0x29820
callq 0x120d0
movq %rax, %r14
movl (%rax), %edi
callq 0x128e0
leaq 0x2c5a6(%rip), %rsi     # 0x55e9f
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x19c06
movl (%r14), %edi
callq 0x128e0
leaq 0x2c5a2(%rip), %rsi     # 0x55eb9
movq %rbx, %rdi
movq %rax, %rdx
jmp 0x298c9
nop
// File: /workspace/github_c_makefile_star2_O3/erikdubbelboer[P]discnt/src/debug.c
// Function: bugReportStart
void bugReportStart(void) {
    if (server.bug_report_start == 0) {
        serverLog(LL_WARNING,
            "\n\n=== DISCNT BUG REPORT START: Cut & paste starting from here ===");
        server.bug_report_start = 1;
    }
}

// Assembly:
pushq %rbx
leaq 0x44b68(%rip), %rbx     # 0x6f088
cmpl $0x0, 0x694(%rbx)
jne 0x2a546
leaq 0x2beee(%rip), %rsi     # 0x5641e
movl $0x3, %edi
xorl %eax, %eax
callq 0x19c06
movl $0x1, 0x694(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
movq %rdi, %rbx
movl (%rdi), %edx
andl $0xf, %edx
leaq 0x2bc19(%rip), %rsi     # 0x562f3
movl $0x3, %edi
xorl %eax, %eax
callq 0x19c06
movl (%rbx), %edx
shrl $0x4, %edx
andl $0xf, %edx
leaq 0x2bc0e(%rip), %rsi     # 0x56303
movl $0x3, %edi
xorl %eax, %eax
callq 0x19c06
movl 0x4(%rbx), %edx
leaq 0x2bc0c(%rip), %rsi     # 0x56317
movl $0x3, %edi
xorl %eax, %eax
callq 0x19c06
movl (%rbx), %eax
testb $0xf, %al
je 0x2a71f
popq %rbx
retq
shrl $0x4, %eax
testb $0xd, %al
jne 0x2a71d
movq 0x8(%rbx), %rax
movzbl -0x1(%rax), %edx
movl %edx, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x2a764
leaq 0x2b849(%rip), %rsi     # 0x55f88
movslq (%rsi,%rcx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
shrl $0x3, %edx
jmp 0x2a766
movq -0x11(%rax), %rdx
jmp 0x2a766
movzwl -0x5(%rax), %edx
jmp 0x2a766
movl -0x9(%rax), %edx
jmp 0x2a766
movzbl -0x3(%rax), %edx
jmp 0x2a766
xorl %edx, %edx
leaq 0x2bbbe(%rip), %rsi     # 0x5632b
movl $0x3, %edi
xorl %eax, %eax
callq 0x19c06
movq 0x8(%rbx), %rax
movzbl -0x1(%rax), %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
je 0x2a79e
cmpl $0x3, %ecx
je 0x2a799
cmpl $0x2, %ecx
jne 0x2a7ae
movzwl -0x5(%rax), %eax
jmp 0x2a7a2
movl -0x9(%rax), %eax
jmp 0x2a7a2
movq -0x11(%rax), %rax
cmpq $0xfff, %rax            # imm = 0xFFF
ja 0x2a71d
callq 0x1db82
movq 0x8(%rbx), %rsi
movzbl -0x1(%rsi), %edx
movl %edx, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x2a7f1
leaq 0x2b7d0(%rip), %rdi     # 0x55f9c
movslq (%rdi,%rcx,4), %rcx
addq %rdi, %rcx
jmpq *%rcx
shrl $0x3, %edx
jmp 0x2a7f3
movq -0x11(%rsi), %rdx
jmp 0x2a7f3
movzwl -0x5(%rsi), %edx
jmp 0x2a7f3
movl -0x9(%rsi), %edx
jmp 0x2a7f3
movzbl -0x3(%rsi), %edx
jmp 0x2a7f3
xorl %edx, %edx
movq %rax, %rdi
callq 0x1f52f
movq %rax, %rbx
leaq 0x2bb41(%rip), %rsi     # 0x56346
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x19c06
movq %rbx, %rdi
popq %rbx
jmp 0x1dc25
// File: /workspace/github_c_makefile_star2_O3/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 0x44610(%rip), %rax     # 0x6f088
movq 0x5f0(%rax), %rdi
movb (%rdi), %bpl
testb %bpl, %bpl
je 0x2aaa1
movl $0x441, %esi            # imm = 0x441
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x126e0
movl %eax, %ebx
cmpl $-0x1, %eax
jne 0x2aaa6
jmp 0x2aadc
movl $0x1, %ebx
movq %rsp, %rdi
movl $0x64, %esi
callq 0x12260
movq 0xa8(%r14), %rcx
testq %rcx, %rcx
je 0x2aac4
movq %rcx, 0x8(%rsp)
movq %rsp, %rdi
movl %eax, %esi
movl %ebx, %edx
callq 0x120a0
testb %bpl, %bpl
je 0x2aadc
movl %ebx, %edi
callq 0x123b0
addq $0x320, %rsp            # imm = 0x320
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x44591(%rip), %rax     # 0x6f088
movq 0x200(%rax), %rbx
testq %rbx, %rbx
je 0x2ab95
leaq 0x2ba48(%rip), %rsi     # 0x56556
movl $0x3, %edi
xorl %eax, %eax
callq 0x19c06
callq 0x1db82
movq %rax, %rdi
movq %rbx, %rsi
callq 0x23af0
movq %rax, %r14
leaq 0x2a339(%rip), %rsi     # 0x54e6d
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x19c06
movq %r14, %rdi
callq 0x1dc25
cmpl $0x0, 0x28(%rbx)
jle 0x2ab95
leaq 0x2ba16(%rip), %r14     # 0x5656e
xorl %r15d, %r15d
movq 0x30(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x25c6b
movq %rax, %r12
movq 0x8(%rax), %rcx
movl $0x3, %edi
movq %r14, %rsi
movl %r15d, %edx
xorl %eax, %eax
callq 0x19c06
movq %r12, %rdi
callq 0x25945
incq %r15
movslq 0x28(%rbx), %rax
cmpq %rax, %r15
jl 0x2ab5b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x1fbbd
movq %rax, %rbx
testq %r14, %r14
je 0x2b9b1
movq 0x20(%r14), %rax
movq %rax, 0x20(%rbx)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
jmp 0x2b9be
movq %rbx, %rdi
movl $0x28, %esi
callq 0x25251
callq 0x19e27
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 0x164dc
movq %rax, 0x90(%rbx)
leaq -0xbcf0(%rip), %rcx     # 0x1fd17
movq %rcx, 0x18(%rax)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x41fff(%rip), %r14     # 0x6dfb8
leaq 0x10(%rsp), %r15
leaq 0x39b(%rip), %rbp       # 0x2c360
movl $0x2e, %ecx
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
leaq 0xc(%rsp), %r8
callq 0x17ff0
cmpl $-0x1, %eax
je 0x2c041
movl %eax, %r13d
xorl %edi, %edi
movl %eax, %esi
callq 0x17589
xorl %edi, %edi
movl %r13d, %esi
callq 0x176bb
movl 0xc(%rsp), %ecx
movl $0x1, %edi
leaq 0x2ad83(%rip), %rsi     # 0x56d8a
movq %r15, %rdx
xorl %eax, %eax
callq 0x19c06
xorl %edi, %edi
callq 0x2c2a9
movl %r13d, 0x8(%rax)
leaq 0x43065(%rip), %rcx     # 0x6f088
movq 0x38(%rcx), %rdi
movl %r13d, %esi
movl $0x1, %edx
movq %rbp, %rcx
movq %rax, %r8
callq 0x16d02
incl %r12d
jne 0x2bfc5
jmp 0x2c06a
callq 0x120d0
cmpl $0xb, (%rax)
je 0x2c06a
movl $0x218, %edx            # imm = 0x218
addq 0x41f61(%rip), %rdx     # 0x6dfb8
leaq 0x2ad11(%rip), %rsi     # 0x56d6f
movl $0x1, %edi
xorl %eax, %eax
callq 0x19c06
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x43004(%rip), %r14     # 0x6f088
movq 0x668(%r14), %rax
andl $-0x2, 0x28(%rax)
movl $0x0, 0xc(%rax)
movq 0x10(%rax), %rdi
callq 0x18ec7
movq %rax, %rbx
movq %rax, %rdi
callq 0x18ef7
testq %rax, %rax
je 0x2c0c8
movq 0x8(%rax), %rax
testb $0x8, 0x30(%rax)
jne 0x2c0c3
movq 0x668(%r14), %rax
incl 0xc(%rax)
movq %rbx, %rdi
jmp 0x2c0a5
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x18fbf
// File: /workspace/github_c_makefile_star2_O3/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 0x42fa6(%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 0x1fc79
movq 0x668(%r14), %rcx
movq %rax, 0x30(%rcx)
movq $0x0, 0x38(%rcx)
movq 0x10(%rcx), %rdi
callq 0x18e9d
movq %rax, %rbx
movq %rax, %rdi
callq 0x18ef7
testq %rax, %rax
je 0x2c167
movq 0x8(%rax), %rax
movl 0x30(%rax), %ecx
testb $0x3, %cl
je 0x2c144
movq 0x668(%r14), %rdx
incl 0x3c(%rdx)
testb $0xf, %cl
jne 0x2c162
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 0x2c124
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x18fbf
// File: /workspace/github_c_makefile_star2_O3/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 0x42f04(%rip), %r15     # 0x6f088
movq 0x668(%r15), %rax
movq 0x10(%rax), %rdi
callq 0x18ec7
movq %rax, %r14
movq %rax, %rdi
callq 0x18ef7
testq %rax, %rax
je 0x2c1bb
movq 0x8(%rax), %rdi
cmpq 0x573f1(%rip), %rdi     # 0x835a0
je 0x2c1b6
callq 0x2c23c
movq %r14, %rdi
jmp 0x2c19a
movq %r14, %rdi
callq 0x18fbf
callq 0x2c0d7
testl %ebx, %ebx
je 0x2c226
movq 0x573cd(%rip), %rdi     # 0x835a0
movl $0x28, %esi
callq 0x1da70
movq %rax, %rbx
movq 0x668(%r15), %rax
movq 0x10(%rax), %rdi
movq %rbx, %rsi
callq 0x18a7c
movq %rbx, %rdi
callq 0x1dc25
movq 0x5739e(%rip), %rdi     # 0x835a0
movl $0x28, %esi
callq 0x25251
movq 0x5738d(%rip), %rdx     # 0x835a0
movq 0x668(%r15), %rax
movq 0x10(%rax), %rdi
movq %rdx, %rsi
callq 0x18802
callq 0x1a29a
movq 0x668(%r15), %rax
orl $0x7, 0x28(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x42e3e(%rip), %rax     # 0x6f088
movq 0x668(%rax), %rax
movq 0x10(%rax), %rdi
callq 0x18ec7
movq %rax, %r14
movq %rax, %rdi
callq 0x18ef7
testq %rax, %rax
je 0x2c280
movq 0x8(%rax), %rdi
cmpq %rbx, %rdi
je 0x2c27b
movq %rbx, %rsi
callq 0x2c5d1
movq %r14, %rdi
jmp 0x2c260
movq %r14, %rdi
callq 0x18fbf
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2c64c
// File: /workspace/github_c_makefile_star2_O3/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 0x42a2e(%rip), %r14     # 0x6f088
movq 0x668(%r14), %rax
movq 0x10(%rax), %rdi
movq %rbx, %rsi
callq 0x18a7c
testl %eax, %eax
jne 0x2c6c5
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0x2c682
callq 0x2c2ee
testb $0x8, 0x30(%rbx)
jne 0x2c6aa
movq 0x668(%r14), %rax
movq 0x18(%rax), %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x18802
orb $0x40, 0x30(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x90(%rbx), %rdi
callq 0x164fc
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1fd17
leaq 0x2a6da(%rip), %rdi     # 0x56da6
leaq 0x2a3be(%rip), %rsi     # 0x56a91
movl $0x27f, %edx            # imm = 0x27F
callq 0x2a46a
movl $0x1, %edi
callq 0x12120
// File: /workspace/github_c_makefile_star2_O3/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 0x1da70
movq %rax, %rbx
callq 0x2c79a
leaq 0x42872(%rip), %r14     # 0x6f088
movq 0x668(%r14), %rax
movq 0x20(%rax), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x18802
testl %eax, %eax
jne 0x2c83a
movq %rbx, %rdi
callq 0x1dbd5
movq %rax, %rbx
movq 0x668(%r14), %rax
movq 0x20(%rax), %rdi
movq %rbx, %rsi
callq 0x18d3e
movq %rax, %r14
xorl %edi, %edi
callq 0x12540
addq $0x3c, %rax
movq %rax, 0x8(%r14)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1dc25
// File: /workspace/github_c_makefile_star2_O3/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 0x2c936
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x427b8(%rip), %r14     # 0x6f088
movq 0x668(%r14), %rax
movl 0xc(%rax), %eax
movl %eax, %ebp
shrl $0x1f, %ebp
addl %eax, %ebp
sarl %ebp
callq 0x2c550
movq 0x90(%rbx), %rax
cmpl 0x28(%rax), %ebp
jg 0x2c932
leaq 0x2a4ff(%rip), %rsi     # 0x56dfa
movl $0x1, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x19c06
movl 0x30(%rbx), %eax
andl $-0x4, %eax
orl $0x2, %eax
movl %eax, 0x30(%rbx)
callq 0x19e27
movq %rax, 0x48(%rbx)
movq %rbx, %rdi
callq 0x2c937
movq 0x668(%r14), %rax
orl $0x3, 0x28(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x56c37(%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 0x42701(%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
movups 0x10(%r14), %xmm1
movaps %xmm0, 0x60(%rbx)
movaps %xmm1, 0x70(%rbx)
movq 0x20(%r14), %rcx
movq %rcx, 0x80(%rbx)
movq 0x10(%rax), %rdi
movl $0x88, %edx
movq %rbx, %rsi
callq 0x2d97f
addq $0xc8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2ca26
movq %rdi, %rbx
leaq 0x2a43c(%rip), %rsi     # 0x56e3b
movl $0x1, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x19c06
andb $-0x3, 0x30(%rbx)
leaq 0x4266f(%rip), %rax     # 0x6f088
movq 0x668(%rax), %rax
orl $0x3, 0x28(%rax)
popq %rbx
retq
leaq 0x2a3fd(%rip), %rdi     # 0x56e2a
leaq 0x2a05d(%rip), %rsi     # 0x56a91
movl $0x344, %edx            # imm = 0x344
callq 0x2a46a
movl $0x1, %edi
callq 0x12120
// File: /workspace/github_c_makefile_star2_O3/erikdubbelboer[P]discnt/src/cluster.c
// Function: nodeUpdateAddressIfNeeded
int nodeUpdateAddressIfNeeded(clusterNode *node, clusterLink *link, int port) {
    char ip[NET_IP_STR_LEN] = {0};

    /* We don't proceed if the link is the same as the sender link, as this
     * function is designed to see if the node link is consistent with the
     * symmetric link that is used to receive PINGs from the node.
     *
     * As a side effect this function never frees the passed 'link', so
     * it is safe to call during packet processing. */
    if (link == node->link) return 0;

    nodeIp2String(ip,link);
    if (node->port == port && strcmp(ip,node->ip) == 0) return 0;

    /* IP / port is different, update it. */
    memcpy(node->ip,ip,sizeof(ip));
    node->port = port;
    if (node->link) freeClusterLink(node->link);
    node->flags &= ~CLUSTER_NODE_NOADDR;
    serverLog(LL_WARNING,"Address updated for node %.40s, now %s:%d",
        node->name, node->ip, node->port);

    return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
xorps %xmm0, %xmm0
movups %xmm0, 0x1e(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
cmpq %rsi, 0x88(%rdi)
je 0x2ce50
movl %edx, %ebp
movq %rdi, %rbx
movl 0x8(%rsi), %edi
xorl %r14d, %r14d
movq %rsp, %rsi
movl $0x2e, %edx
xorl %ecx, %ecx
callq 0x180ed
cmpl %ebp, 0x80(%rbx)
jne 0x2cded
leaq 0x50(%rbx), %rsi
movq %rsp, %rdi
callq 0x12490
testl %eax, %eax
je 0x2ce53
leaq 0x50(%rbx), %r14
movups 0x1e(%rsp), %xmm0
movups %xmm0, 0x6e(%rbx)
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movups %xmm1, 0x60(%rbx)
movups %xmm0, 0x50(%rbx)
movl %ebp, 0x80(%rbx)
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0x2ce28
callq 0x2c2ee
movl 0x80(%rbx), %ebp
andb $-0x11, 0x30(%rbx)
leaq 0x2a0a0(%rip), %rsi     # 0x56ed3
movl $0x3, %edi
movq %rbx, %rdx
movq %r14, %rcx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x19c06
movl $0x1, %r14d
jmp 0x2ce53
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/erikdubbelboer[P]discnt/src/cluster.c
// Function: cluserReadShard
void cluserReadShard(const clusterMsgDataCounter *msg, clusterNode *node) {
    uint32_t name_length, revision;
    long double predict_value, predict_change;
    mstime_t predict_time;
    sds name;
    counter *cntr;
    listNode *ln;
    listIter li;
    shard *shrd = NULL;

    name_length = intrev16ifbe(msg->name_length);
    name = sdsnewlen(msg->name,name_length);

    revision       = intrev32ifbe(msg->revision);
    predict_time   = intrev64ifbe(msg->predict_time);
    predict_value  = unpack754(intrev64ifbe(msg->predict_value), 64, 11);
    predict_change = unpack754(intrev64ifbe(msg->predict_change), 64, 11);

    serverLog(LL_DEBUG,"Read shard for %s from %.40s %llu %Lf %Lf",
        name, node->name, predict_time, predict_value, predict_change);

    cntr = counterLookup(name);
    if (cntr == NULL) {
        cntr = counterCreate(name);
    } else {
        listRewind(cntr->shards,&li);
        while ((ln = listNext(&li)) != NULL) {
            shrd = listNodeValue(ln);

            if (shrd->node == node) {
                break;
            }
        }
    }

    if ((shrd == NULL) || (shrd->node != node)) {
        shrd = counterAddShard(cntr,node,node->name);
    }

    shrd->value          = predict_value;
    shrd->predict_time   = predict_time;
    shrd->predict_value  = predict_value;
    shrd->predict_change = predict_change;

    clusterSendAck(node, revision, name);
    
    server.dirty++;

    sdsfree(name);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq %rdi, %r12
movzwl 0x1c(%rdi), %esi
addq $0x1e, %rdi
callq 0x1da70
movq %rax, %r14
movl 0x18(%r12), %ebp
movq (%r12), %r15
movq 0x8(%r12), %rdi
movl $0x40, %esi
movl $0xb, %edx
callq 0x2eb7f
fstpt 0x30(%rsp)
movq 0x10(%r12), %rdi
movl $0x40, %esi
movl $0xb, %edx
callq 0x2eb7f
fld %st(0)
fstpt 0x3c(%rsp)
fstpt 0x10(%rsp)
fldt 0x30(%rsp)
fstpt (%rsp)
leaq 0x29cea(%rip), %rsi     # 0x57376
xorl %edi, %edi
movq %r14, %rdx
movq %rbx, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x19c06
movq %r14, %rdi
callq 0x30d6f
testq %rax, %rax
je 0x2d6f8
movq %rax, %r12
movq 0x8(%rax), %rdi
leaq 0x48(%rsp), %r13
movq %r13, %rsi
callq 0x16717
movq %r13, %rdi
callq 0x16734
testq %rax, %rax
je 0x2d703
movl %ebp, 0x2c(%rsp)
leaq 0x48(%rsp), %rbp
movq 0x10(%rax), %r13
cmpq %rbx, (%r13)
je 0x2d716
movq %rbp, %rdi
callq 0x16734
testq %rax, %rax
jne 0x2d6d5
cmpq %rbx, (%r13)
movl 0x2c(%rsp), %ebp
jne 0x2d703
jmp 0x2d71a
movq %r14, %rdi
callq 0x30d95
movq %rax, %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x30e26
movq %rax, %r13
jmp 0x2d71a
movl 0x2c(%rsp), %ebp
fldt 0x30(%rsp)
fld %st(0)
fstpt 0x30(%r13)
movq %r15, 0x40(%r13)
fstpt 0x50(%r13)
fldt 0x3c(%rsp)
fstpt 0x60(%r13)
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x2e7a7
leaq 0x41940(%rip), %rax     # 0x6f088
incq 0x6a0(%rax)
movq %r14, %rdi
callq 0x1dc25
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq