LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterHandshakeInProgress
int clusterHandshakeInProgress(char *ip, int port) {
    dictIterator *di;
    dictEntry *de;

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

        if (!nodeInHandshake(node)) continue;
        if (!strcasecmp(node->ip,ip) && node->port == port) break;
    }
    dictReleaseIterator(di);
    return de != NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
leaq 0x4203d(%rip), %rax     # 0x6f088
movq 0x668(%rax), %rax
movq 0x10(%rax), %rdi
callq 0x1926c
movq %rax, %r15
movq %rax, %rdi
callq 0x1929d
testq %rax, %rax
setne %bpl
je 0x2d09b
movq 0x8(%rax), %r12
testb $0x8, 0x30(%r12)
je 0x2d096
leaq 0x50(%r12), %rdi
movq %r14, %rsi
callq 0x12090
testl %eax, %eax
jne 0x2d096
cmpl %ebx, 0x80(%r12)
je 0x2d09b
movq %r15, %rdi
jmp 0x2d061
movq %r15, %rdi
callq 0x1935a
movzbl %bpl, %eax
andl $0x1, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterStartHandshake
int clusterStartHandshake(char *ip, int port) {
    clusterNode *n;
    char norm_ip[NET_IP_STR_LEN];
    struct sockaddr_storage sa;

    /* IP sanity check */
    if (inet_pton(AF_INET,ip,
            &(((struct sockaddr_in *)&sa)->sin_addr)))
    {
        sa.ss_family = AF_INET;
    } else if (inet_pton(AF_INET6,ip,
            &(((struct sockaddr_in6 *)&sa)->sin6_addr)))
    {
        sa.ss_family = AF_INET6;
    } else {
        errno = EINVAL;
        return 0;
    }

    /* Port sanity check */
    if (port <= 0 || port > (65535-CLUSTER_PORT_INCR)) {
        errno = EINVAL;
        return 0;
    }

    /* Set norm_ip as the normalized string representation of the node
     * IP address. */
    memset(norm_ip,0,NET_IP_STR_LEN);
    if (sa.ss_family == AF_INET)
        inet_ntop(AF_INET,
            (void*)&(((struct sockaddr_in *)&sa)->sin_addr),
            norm_ip,NET_IP_STR_LEN);
    else
        inet_ntop(AF_INET6,
            (void*)&(((struct sockaddr_in6 *)&sa)->sin6_addr),
            norm_ip,NET_IP_STR_LEN);

    if (clusterHandshakeInProgress(norm_ip,port)) {
        errno = EAGAIN;
        return 0;
    }

    /* Add the node with a random address (NULL as first argument to
     * createClusterNode()). Everything will be fixed during the
     * handshake. */
    n = createClusterNode(NULL,CLUSTER_NODE_HANDSHAKE|CLUSTER_NODE_MEET);
    memcpy(n->ip,norm_ip,sizeof(n->ip));
    n->port = port;
    clusterAddNode(n);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xb8, %rsp
movl %esi, %ebx
movq %rdi, %r15
leaq 0x3c(%rsp), %r14
movl $0x2, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x12530
movl %eax, %ebp
movw $0x2, %cx
testl %eax, %eax
jne 0x2d0fe
leaq 0x40(%rsp), %rdx
movl $0xa, %edi
movq %r15, %rsi
callq 0x12530
movw $0xa, %cx
testl %eax, %eax
je 0x2d10f
movw %cx, 0x38(%rsp)
movl $0xffff2710, %eax       # imm = 0xFFFF2710
leal (%rbx,%rax), %ecx
cmpl %eax, %ecx
ja 0x2d11c
callq 0x120d0
movl $0x16, (%rax)
jmp 0x2d16e
xorps %xmm0, %xmm0
movups %xmm0, 0x1e(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
testl %ebp, %ebp
je 0x2d13e
movq %rsp, %rdx
movl $0x2, %edi
movq %r14, %rsi
jmp 0x2d14b
leaq 0x40(%rsp), %rsi
movq %rsp, %rdx
movl $0xa, %edi
movl $0x2e, %ecx
callq 0x12040
movq %rsp, %rdi
movl %ebx, %esi
callq 0x2d037
testl %eax, %eax
je 0x2d17e
callq 0x120d0
movl $0xb, (%rax)
xorl %eax, %eax
addq $0xb8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
movl $0x28, %esi
callq 0x2bf69
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movups %xmm0, 0x50(%rax)
movups %xmm1, 0x60(%rax)
movups 0x1e(%rsp), %xmm0
movups %xmm0, 0x6e(%rax)
movl %ebx, 0x80(%rax)
leaq 0x41ed7(%rip), %rcx     # 0x6f088
movq 0x668(%rcx), %rcx
movq 0x10(%rcx), %rdi
movq %rax, %rsi
movq %rax, %rdx
callq 0x18b97
movl $0x1, %eax
jmp 0x2d170
// File: /workspace/github_c_makefile_star2_O1/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 0x2d410
movl %edx, %ebp
movq %rdi, %rbx
movl 0x8(%rsi), %edi
xorl %r14d, %r14d
movq %rsp, %rsi
movl $0x2e, %edx
xorl %ecx, %ecx
callq 0x1848c
cmpl %ebp, 0x80(%rbx)
jne 0x2d3af
leaq 0x50(%rbx), %rsi
movq %rsp, %rdi
callq 0x124a0
testl %eax, %eax
je 0x2d413
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 0x2d3e4
callq 0x2c8d9
andb $-0x11, 0x30(%rbx)
movl 0x80(%rbx), %r8d
leaq 0x29af1(%rip), %rsi     # 0x56ee7
movl $0x3, %edi
movq %rbx, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x19fb1
movl $0x1, %r14d
jmp 0x2d413
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1dd2c
movq %rax, %r14
movl 0x18(%r12), %ebp
movq (%r12), %r15
movq 0x8(%r12), %rdi
movl $0x40, %esi
movl $0xb, %edx
callq 0x2f159
fstpt 0x30(%rsp)
movq 0x10(%r12), %rdi
movl $0x40, %esi
movl $0xb, %edx
callq 0x2f159
fld %st(0)
fstpt 0x3c(%rsp)
fstpt 0x10(%rsp)
fldt 0x30(%rsp)
fstpt (%rsp)
leaq 0x2971e(%rip), %rsi     # 0x5738a
xorl %edi, %edi
movq %r14, %rdx
movq %rbx, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x19fb1
movq %r14, %rdi
callq 0x31327
testq %rax, %rax
je 0x2dcd2
movq %rax, %r12
movq 0x8(%rax), %rdi
leaq 0x48(%rsp), %r13
movq %r13, %rsi
callq 0x16c72
movq %r13, %rdi
callq 0x16c8f
testq %rax, %rax
je 0x2dcdd
movl %ebp, 0x2c(%rsp)
leaq 0x48(%rsp), %rbp
movq 0x10(%rax), %r13
cmpq %rbx, (%r13)
je 0x2dccc
movq %rbp, %rdi
callq 0x16c8f
testq %rax, %rax
jne 0x2dcb5
movl 0x2c(%rsp), %ebp
jmp 0x2dce0
movq %r14, %rdi
callq 0x3134d
movq %rax, %r12
xorl %r13d, %r13d
testq %r13, %r13
je 0x2dceb
cmpq %rbx, (%r13)
je 0x2dcfc
movq %r12, %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x313de
movq %rax, %r13
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 0x2ed81
leaq 0x4135e(%rip), %rax     # 0x6f088
incq 0x6a0(%rax)
movq %r14, %rdi
callq 0x1ded3
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/cluster.c
// Function: cluserReadAck
void cluserReadAck(const clusterMsgDataAck *msg, clusterNode *node) {
    uint32_t name_length, revision;
    counter *cntr;
    sds name;

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

    revision = intrev32ifbe(msg->revision);

    cntr = counterLookup(name);
    if (cntr != NULL) {
        if (cntr->revision == revision) {
            counterGotAck(cntr,node);
        } else {
            serverLog(LL_VERBOSE,"Ack from %.40s for invalid revision %u of %s at %u",
                node->name, revision, name, cntr->revision);
        }
    } else {
        serverLog(LL_VERBOSE,"Ack from %.40s for unknown counter %s",
            node->name, name);
    }

    sdsfree(name);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movzwl 0x4(%rdi), %esi
addq $0x6, %rdi
callq 0x1dd2c
movq %rax, %rbx
movl (%r15), %ebp
movq %rax, %rdi
callq 0x31327
testq %rax, %rax
je 0x2dd8b
movl 0x38(%rax), %r9d
cmpl %ebp, %r9d
jne 0x2dda6
movq %rax, %rdi
movq %r14, %rsi
callq 0x31271
jmp 0x2ddc1
leaq 0x2968e(%rip), %rsi     # 0x57420
movl $0x1, %edi
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x19fb1
jmp 0x2ddc1
leaq 0x29640(%rip), %rsi     # 0x573ed
movl $0x1, %edi
movq %r14, %rdx
movl %ebp, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0x19fb1
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1ded3
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterWriteHandler
void clusterWriteHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
    clusterLink *link = (clusterLink*) privdata;
    ssize_t nwritten;
    UNUSED(el);
    UNUSED(mask);

    nwritten = write(fd, link->sndbuf, sdslen(link->sndbuf));
    if (nwritten <= 0) {
        serverLog(LL_DEBUG,"I/O error writing to node link: %s",
            strerror(errno));
        handleLinkIOError(link);
        return;
    }
    sdsrange(link->sndbuf,nwritten,-1);
    if (sdslen(link->sndbuf) == 0)
        aeDeleteFileEvent(server.el, link->fd, AE_WRITABLE);
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
movl %esi, %edi
movq 0x10(%rdx), %rsi
movzbl -0x1(%rsi), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x2de1c
leaq 0x28b45(%rip), %rcx     # 0x5693c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x2de1e
movq -0x11(%rsi), %rdx
jmp 0x2de1e
movzwl -0x5(%rsi), %edx
jmp 0x2de1e
movl -0x9(%rsi), %edx
jmp 0x2de1e
movzbl -0x3(%rsi), %edx
jmp 0x2de1e
xorl %edx, %edx
callq 0x121e0
testq %rax, %rax
jle 0x2de5f
movq 0x10(%rbx), %rdi
movl %eax, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1f352
movq 0x10(%rbx), %rcx
movzbl -0x1(%rcx), %eax
movl %eax, %edx
andl $0x7, %edx
cmpl $0x4, %edx
ja 0x2de9e
leaq 0x28aff(%rip), %rsi     # 0x56950
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
shrl $0x3, %eax
jmp 0x2dea0
callq 0x120d0
movl (%rax), %edi
callq 0x128f0
leaq 0x291be(%rip), %rsi     # 0x57030
xorl %edi, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x19fb1
movq %rbx, %rdi
popq %rbx
jmp 0x2c8d9
movq -0x11(%rcx), %rax
jmp 0x2dea0
movzwl -0x5(%rcx), %eax
jmp 0x2dea0
movl -0x9(%rcx), %eax
jmp 0x2dea0
movzbl -0x3(%rcx), %eax
jmp 0x2dea0
xorl %eax, %eax
testq %rax, %rax
je 0x2dea7
popq %rbx
retq
leaq 0x411da(%rip), %rax     # 0x6f088
movq 0x38(%rax), %rdi
movl 0x8(%rbx), %esi
movl $0x2, %edx
popq %rbx
jmp 0x1713d
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterSendMessage
void clusterSendMessage(clusterLink *link, unsigned char *msg, size_t msglen) {
    if (sdslen(link->sndbuf) == 0 && msglen != 0)
        aeCreateFileEvent(server.el,link->fd,AE_WRITABLE,
                    clusterWriteHandler,link);

    link->sndbuf = sdscatlen(link->sndbuf, msg, msglen);
    server.cluster->stats_bus_messages_sent++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x10(%rdi), %rcx
movzbl -0x1(%rcx), %eax
movl %eax, %edx
andl $0x7, %edx
cmpl $0x4, %edx
ja 0x2df0c
leaq 0x28a7d(%rip), %rsi     # 0x56964
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
shrl $0x3, %eax
jmp 0x2df0e
movq -0x11(%rcx), %rax
jmp 0x2df0e
movzwl -0x5(%rcx), %eax
jmp 0x2df0e
movl -0x9(%rcx), %eax
jmp 0x2df0e
movzbl -0x3(%rcx), %eax
jmp 0x2df0e
xorl %eax, %eax
testq %r14, %r14
je 0x2df3a
testq %rax, %rax
jne 0x2df3a
leaq 0x41169(%rip), %rax     # 0x6f088
movq 0x38(%rax), %rdi
movl 0x8(%rbx), %esi
leaq -0x155(%rip), %rcx      # 0x2ddd8
movl $0x2, %edx
movq %rbx, %r8
callq 0x17077
movq 0x10(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1e66d
movq %rax, 0x10(%rbx)
leaq 0x41134(%rip), %rax     # 0x6f088
movq 0x668(%rax), %rax
incq 0x40(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterBroadcastMessage
void clusterBroadcastMessage(dict *nodes, void *buf, size_t len) {
    dictIterator *di;
    dictEntry *de;

    di = dictGetSafeIterator(nodes);
    while((de = dictNext(di)) != NULL) {
        clusterNode *node = dictGetKey(de);

        if (!node->link) continue;
        if (node->flags & (CLUSTER_NODE_MYSELF|CLUSTER_NODE_HANDSHAKE))
            continue;
        clusterSendMessage(node->link,buf,len);
    }
    dictReleaseIterator(di);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
callq 0x1926c
movq %rax, %r15
movq %rax, %rdi
callq 0x1929d
testq %rax, %rax
je 0x2dfaa
movq (%rax), %rax
movq 0x88(%rax), %rdi
testq %rdi, %rdi
je 0x2dfa5
testb $0xc, 0x30(%rax)
jne 0x2dfa5
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2dec0
movq %r15, %rdi
jmp 0x2df7b
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1935a
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterBuildMessageHdr
void clusterBuildMessageHdr(clusterMsg *hdr, int type) {
    int totlen = 0;

    memset(hdr,0,sizeof(*hdr));
    hdr->ver = htons(CLUSTER_PROTO_VER);
    hdr->sig[0] = 'D';
    hdr->sig[1] = 'b';
    hdr->sig[2] = 'u';
    hdr->sig[3] = 'Z';
    hdr->type = htons(type);
    memcpy(hdr->sender,myself->name,CLUSTER_NAMELEN);
    hdr->port = htons(server.port);
    hdr->flags = htons(myself->flags);
    hdr->state = server.cluster->state;

    /* Compute the message length for certain messages. For other messages
     * this is up to the caller. */
    if (type == CLUSTERMSG_TYPE_FAIL) {
        totlen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
        totlen += sizeof(clusterMsgDataFail);
    } else if (type == CLUSTERMSG_TYPE_RESET) {
        totlen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
        totlen += sizeof(clusterMsgDataReset);
    }
    hdr->totlen = htonl(totlen);
    /* For PING, PONG, MEET and COUNTER, fixing the totlen field is up to the caller. */
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
xorl %r14d, %r14d
movl $0xc8, %edx
xorl %esi, %esi
callq 0x12380
movl $0x5a756244, (%rbx)     # imm = 0x5A756244
movl %ebp, %eax
rolw $0x8, %ax
movw %ax, 0xc(%rbx)
movq 0x555ba(%rip), %rax     # 0x835a0
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm0, 0x10(%rbx)
movups %xmm1, 0x20(%rbx)
movq 0x20(%rax), %rcx
movq %rcx, 0x30(%rbx)
leaq 0x41084(%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), %al
movb %al, 0x5c(%rbx)
cmpl $0x6, %ebp
movl $0x64000000, %eax       # imm = 0x64000000
cmovnel %r14d, %eax
cmpl $0x3, %ebp
movl $0x88000000, %ecx       # imm = 0x88000000
cmovnel %eax, %ecx
movl %ecx, 0x4(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterBeforeSleep
void clusterBeforeSleep(void) {
    /* Update the cluster state. */
    if (server.cluster->todo_before_sleep & CLUSTER_TODO_UPDATE_STATE)
        clusterUpdateState();

    /* Save the config, possibly using fsync. */
    if (server.cluster->todo_before_sleep & CLUSTER_TODO_SAVE_CONFIG) {
        int fsync = server.cluster->todo_before_sleep &
                    CLUSTER_TODO_FSYNC_CONFIG;
        clusterSaveConfigOrDie(fsync);
    }

    /* Reset our flags (not strictly needed since every single function
     * called for flags set should be able to clear its flag). */
    server.cluster->todo_before_sleep = 0;
}

// Assembly:
pushq %rbx
leaq 0x40c66(%rip), %rbx     # 0x6f088
movq 0x668(%rbx), %rax
testb $0x1, 0x28(%rax)
je 0x2e434
callq 0x2c664
movq 0x668(%rbx), %rax
movl 0x28(%rax), %edi
testb $0x2, %dil
je 0x2e44c
andl $0x4, %edi
callq 0x2c2b5
movq 0x668(%rbx), %rax
movl $0x0, 0x28(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: representClusterNodeFlags
sds representClusterNodeFlags(sds ci, uint16_t flags) {
    if (flags == 0) {
        ci = sdscat(ci,"noflags,");
    } else {
        int i, size = sizeof(discntNodeFlagsTable)/sizeof(struct discntNodeFlags);
        for (i = 0; i < size; i++) {
            struct discntNodeFlags *nodeflag = discntNodeFlagsTable + i;
            if (flags & nodeflag->flag) ci = sdscat(ci, nodeflag->name);
        }
    }
    sdsIncrLen(ci,-1); /* Remove trailing comma. */
    return ci;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0x2e49c
movl %esi, %ebp
movl $0x8, %r14d
leaq 0x3de07(%rip), %r15     # 0x6c280
testw %bp, -0x8(%r14,%r15)
je 0x2e490
movq (%r14,%r15), %rsi
movq %rbx, %rdi
callq 0x1e73d
movq %rax, %rbx
addq $0x10, %r14
cmpq $0x58, %r14
jne 0x2e479
jmp 0x2e4ae
leaq 0x28c9b(%rip), %rsi     # 0x5713e
movq %rbx, %rdi
callq 0x1e73d
movq %rax, %rbx
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x1e3ca
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterGenNodeDescription
sds clusterGenNodeDescription(clusterNode *node) {
    sds ci;

    /* Node coordinates */
    ci = sdscatprintf(sdsempty(),"%.40s %s:%d ",
        node->name,
        node->ip,
        node->port);

    /* Flags */
    ci = representClusterNodeFlags(ci, node->flags);

    /* Latency from the POV of this node, link status */
    ci = sdscatprintf(ci," %lld %lld %s",
        (long long) node->ping_sent,
        (long long) node->pong_received,
        (node->link || node->flags & CLUSTER_NODE_MYSELF) ?
                    "connected" : "disconnected");

    return ci;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x1de3f
leaq 0x50(%rbx), %rcx
movl 0x80(%rbx), %r8d
leaq 0x28c63(%rip), %rsi     # 0x57147
movq %rax, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1eace
movzwl 0x30(%rbx), %esi
movq %rax, %rdi
callq 0x2e45c
movq 0x38(%rbx), %rdx
movq 0x40(%rbx), %rcx
cmpq $0x0, 0x88(%rbx)
je 0x2e518
leaq 0x28c4f(%rip), %r8      # 0x57165
jmp 0x2e52e
testb $0x4, 0x30(%rbx)
leaq 0x28c3f(%rip), %rsi     # 0x57162
leaq 0x28c3b(%rip), %r8      # 0x57165
cmoveq %rsi, %r8
leaq 0x28c1f(%rip), %rsi     # 0x57154
movq %rax, %rdi
xorl %eax, %eax
popq %rbx
jmp 0x1eace
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterShuffleReachableNodes
void clusterShuffleReachableNodes(void) {
    int r, i;
    clusterNode *tmp;
    for(i = server.cluster->reachable_nodes_count - 1; i > 0; i--) {
        r = rand() % (i + 1);
        tmp = server.cluster->reachable_nodes[r];
        server.cluster->reachable_nodes[r] = server.cluster->reachable_nodes[i];
        server.cluster->reachable_nodes[i] = tmp;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0x40b3c(%rip), %rbx     # 0x6f088
movq 0x668(%rbx), %rax
movslq 0x38(%rax), %r14
cmpq $0x2, %r14
jl 0x2e59e
leaq -0x1(%r14), %r15
callq 0x12980
cltd
idivl %r14d
movq 0x668(%rbx), %rax
movq 0x30(%rax), %rax
movslq %edx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x8(%rax,%r14,8), %rsi
movq %rsi, (%rax,%rcx,8)
movq 0x668(%rbx), %rax
movq 0x30(%rax), %rax
movq %rdx, -0x8(%rax,%r14,8)
cmpq $0x2, %r14
movq %r15, %r14
jg 0x2e55d
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: helloCommand
void helloCommand(client *c) {
    dictIterator *di = dictGetIterator(server.cluster->nodes);
    dictEntry *de;

    addReplyMultiBulkLen(c,2+dictSize(server.cluster->nodes));
    addReplyLongLong(c,1); /* Version. */
    addReplyBulkCBuffer(c,myself->name,CLUSTER_NAMELEN); /* My ID. */

    while((de = dictNext(di)) != NULL) {
        clusterNode *node = dictGetVal(de);
        int priority = 1;
        if (node->link == NULL && node != server.cluster->myself) priority = 5;
        if (node->flags & CLUSTER_NODE_PFAIL) priority = 10;
        if (node->flags & CLUSTER_NODE_FAIL) priority = 100;
        addReplyMultiBulkLen(c,4);
        addReplyBulkCBuffer(c,node->name,CLUSTER_NAMELEN); /* ID. */
        addReplyBulkCString(c,node->ip); /* IP address. */
        addReplyBulkLongLong(c,node->port); /* TCP port. */
        addReplyBulkLongLong(c,priority); /* Priority. */
    }
    dictReleaseIterator(di);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x406d9(%rip), %r15     # 0x6f088
movq 0x668(%r15), %rax
movq 0x10(%rax), %rdi
callq 0x19242
movq %rax, %r14
movq 0x668(%r15), %rax
movq 0x10(%rax), %rax
movq 0x28(%rax), %rcx
movq 0x48(%rax), %rax
leaq (%rcx,%rax), %rsi
addq $0x2, %rsi
movq %rbx, %rdi
callq 0x22976
movl $0x1, %esi
movq %rbx, %rdi
callq 0x22941
movq 0x54ba7(%rip), %rsi     # 0x835a0
movl $0x28, %edx
movq %rbx, %rdi
callq 0x22a7d
movq %r14, %rdi
callq 0x1929d
testq %rax, %rax
je 0x2eab8
movl $0xa, %ebp
movl $0x64, %r13d
movq 0x8(%rax), %r15
movl $0x1, %r12d
cmpq $0x0, 0x88(%r15)
jne 0x2ea54
leaq 0x4064b(%rip), %rax     # 0x6f088
movq 0x668(%rax), %rax
xorl %ecx, %ecx
cmpq (%rax), %r15
setne %cl
leaq 0x1(,%rcx,4), %r12
movl 0x30(%r15), %eax
testb $0x1, %al
cmovneq %rbp, %r12
testb $0x2, %al
cmovneq %r13, %r12
movl $0x4, %esi
movq %rbx, %rdi
callq 0x22976
movl $0x28, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x22a7d
leaq 0x50(%r15), %rsi
movq %rbx, %rdi
callq 0x22791
movslq 0x80(%r15), %rsi
movq %rbx, %rdi
callq 0x22b4c
movq %rbx, %rdi
movq %r12, %rsi
callq 0x22b4c
movq %r14, %rdi
callq 0x1929d
testq %rax, %rax
jne 0x2ea22
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1935a
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterSendShard
void clusterSendShard(counter *cntr) {
    dictIterator *di;
    dictEntry *de;
    clusterNode *node;

    counterClearWantAcks(cntr);

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

        if (node == myself) continue;
        if (nodeInHandshake(node)) continue;

        counterWantAck(cntr, node);

        clusterSendShardToNode(cntr, node);
    }
    dictReleaseIterator(di);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x31214
leaq 0x40363(%rip), %rax     # 0x6f088
movq 0x668(%rax), %rax
movq 0x10(%rax), %rdi
callq 0x19242
movq %rax, %r14
movq %rax, %rdi
callq 0x1929d
testq %rax, %rax
je 0x2ed74
movq 0x8(%rax), %r15
cmpq 0x54850(%rip), %r15     # 0x835a0
je 0x2ed6f
testb $0x8, 0x30(%r15)
jne 0x2ed6f
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3123d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2eace
movq %r14, %rdi
jmp 0x2ed3b
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1935a
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterBroadcastResetMessage
void clusterBroadcastResetMessage(void) {
    unsigned char buf[sizeof(clusterMsg)];
    clusterMsg *hdr = (clusterMsg*) buf;

    clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_RESET);
    clusterBroadcastMessage(server.cluster->nodes,buf,ntohl(hdr->totlen));
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movq %rsp, %rbx
movl $0xc8, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x12380
movl $0x5a756244, (%rbx)     # imm = 0x5A756244
movw $0x600, 0xc(%rbx)       # imm = 0x600
movq 0x545e8(%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 0x400b2(%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 $0x64000000, 0x4(%rbx)  # imm = 0x64000000
movq 0x10(%rax), %rdi
movl $0x64, %edx
movq %rbx, %rsi
callq 0x2df65
addq $0xd0, %rsp
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/endianconv.c
// Function: pack754
uint64_t pack754(long double f, unsigned bits, unsigned expbits)
{
    long double fnorm;
    int shift;
    long long sign, exp, significand;
    unsigned significandbits = bits - expbits - 1; // -1 for sign bit

    if (f == 0.0) return 0; // get this special case out of the way

    // check sign and begin normalization
    if (f < 0) { sign = 1; fnorm = -f; }
    else { sign = 0; fnorm = f; }

    // get the normalized form of f and track the exponent
    shift = 0;
    while(fnorm >= 2.0) { fnorm /= 2.0; shift++; }
    while(fnorm < 1.0) { fnorm *= 2.0; shift--; }
    fnorm = fnorm - 1.0;

    // calculate the binary form (non-float) of the significand data
    significand = fnorm * ((1LL<<significandbits) + 0.5f);

    // get the biased exponent
    exp = shift + ((1<<(expbits-1)) - 1); // shift + bias

    // return the final answer
    return (sign<<(bits-1)) | (exp<<(bits-expbits-1)) | significand;
}

// Assembly:
fldt 0x8(%rsp)
xorl %eax, %eax
fldz
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
jne 0x2f085
jp 0x2f085
fstp %st(0)
retq
movl %esi, %edx
notl %edx
fld %st(0)
fchs
xorl %r8d, %r8d
fucomi %st(1), %st
fxch %st(1)
fcmovnbe %st(1), %st
fstp %st(1)
seta %r8b
flds 0x283ce(%rip)           # 0x57470
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
jae 0x2f0ae
fldz
jmp 0x2f0c6
xorl %eax, %eax
flds 0x283ba(%rip)           # 0x57470
fxch %st(1)
fmuls 0x283b6(%rip)           # 0x57474
incl %eax
fucomi %st(1), %st
fxch %st(1)
jae 0x2f0b6
fstp %st(0)
addl %edi, %edx
fld1
fucompi %st(1), %st
jbe 0x2f0e0
fld1
fxch %st(1)
fadd %st, %st(0)
decl %eax
fxch %st(1)
fucomi %st(1), %st
ja 0x2f0d2
jmp 0x2f0e2
fldz
fstp %st(0)
movl $0x1, %r9d
movl %edx, %ecx
shlq %cl, %r9
cvtsi2ss %r9, %xmm0
fld1
fchs
addss 0x28374(%rip), %xmm0    # 0x57474
faddp %st, %st(1)
movss %xmm0, -0xc(%rsp)
fmuls -0xc(%rsp)
fnstcw -0x10(%rsp)
movzwl -0x10(%rsp), %ecx
orl $0xc00, %ecx            # imm = 0xC00
movw %cx, -0xe(%rsp)
fldcw -0xe(%rsp)
fistpll -0x8(%rsp)
fldcw -0x10(%rsp)
decb %sil
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movl %esi, %ecx
shll %cl, %r9d
notl %r9d
addl %eax, %r9d
movslq %r9d, %rax
decb %dil
movl %edi, %ecx
shlq %cl, %r8
movl %edx, %ecx
shlq %cl, %rax
orq %r8, %rax
orq -0x8(%rsp), %rax
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/endianconv.c
// Function: unpack754
long double unpack754(uint64_t i, unsigned bits, unsigned expbits)
{
    long double result;
    long long shift;
    unsigned bias;
    unsigned significandbits = bits - expbits - 1; // -1 for sign bit

    if (i == 0) return 0.0;

    // pull the significand
    result = (i&((1LL<<significandbits)-1)); // mask
    result /= (1LL<<significandbits); // convert back to float
    result += 1.0f; // add the one back on

    // deal with the exponent
    bias = (1<<(expbits-1)) - 1;
    shift = ((i>>significandbits)&((1LL<<expbits)-1)) - bias;
    while(shift > 0) { result *= 2.0; shift--; }
    while(shift < 0) { result /= 2.0; shift++; }

    // sign it
    result *= (i>>(bits-1))&1? -1.0: 1.0;

    return result;
}

// Assembly:
fldz
testq %rdi, %rdi
je 0x2f212
fstp %st(0)
movl %edx, %eax
notl %eax
addl %esi, %eax
movl $0x1, %r8d
movl %eax, %ecx
shlq %cl, %r8
leaq -0x1(%r8), %rcx
xorl %r9d, %r9d
andq %rdi, %rcx
movq %rcx, -0x8(%rsp)
sets %r9b
fildll -0x8(%rsp)
leaq 0x282e3(%rip), %rcx     # 0x57478
fadds (%rcx,%r9,4)
movq %r8, -0x10(%rsp)
fildll -0x10(%rsp)
fdivrp %st, %st(1)
fld1
leal -0x1(%rdx), %ecx
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
shll %cl, %r9d
faddp %st, %st(1)
notl %r9d
movq %rdi, %r10
movl %eax, %ecx
shrq %cl, %r10
movq $-0x1, %r8
movl %edx, %ecx
shlq %cl, %r8
notq %r8
andq %r10, %r8
movq %r8, %rax
subq %r9, %rax
jle 0x2f1ec
subq %r9, %r8
incq %r8
xorl %eax, %eax
fadd %st, %st(0)
decq %r8
cmpq $0x1, %r8
jg 0x2f1e1
testq %rax, %rax
jns 0x2f1ff
negq %rax
fmuls 0x2827a(%rip)           # 0x57474
decq %rax
jne 0x2f1f4
decb %sil
movzbl %sil, %eax
btq %rax, %rdi
fld %st(0)
fchs
fcmovnb %st(1), %st
fstp %st(1)
retq
nop
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/bio.c
// Function: bioInit
void bioInit(void) {
    pthread_attr_t attr;
    pthread_t thread;
    size_t stacksize;
    int j;

    /* Initialization of state vars and objects */
    for (j = 0; j < BIO_NUM_OPS; j++) {
        pthread_mutex_init(&bio_mutex[j],NULL);
        pthread_cond_init(&bio_newjob_cond[j],NULL);
        pthread_cond_init(&bio_step_cond[j],NULL);
        bio_jobs[j] = listCreate();
        bio_pending[j] = 0;
    }

    /* Set the stack size as by default it may be small in some system */
    pthread_attr_init(&attr);
    pthread_attr_getstacksize(&attr,&stacksize);
    if (!stacksize) stacksize = 1; /* The world is full of Solaris Fixes */
    while (stacksize < REDIS_THREAD_STACK_SIZE) stacksize *= 2;
    pthread_attr_setstacksize(&attr, stacksize);

    /* Ready to spawn our threads. We use the single argument the thread
     * function accepts in order to pass the job ID the thread is
     * responsible of. */
    for (j = 0; j < BIO_NUM_OPS; j++) {
        void *arg = (void*)(unsigned long) j;
        if (pthread_create(&thread,&attr,bioProcessBackgroundJobs,arg) != 0) {
            serverLog(LL_WARNING,"Fatal: Can't initialize Background Jobs.");
            exit(1);
        }
        bio_threads[j] = thread;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
leaq 0x54437(%rip), %rbx     # 0x83660
leaq 0x543d0(%rip), %r14     # 0x83600
leaq 0x54379(%rip), %r15     # 0x835b0
xorl %r12d, %r12d
leaq 0x5447f(%rip), %r13     # 0x836c0
leaq 0x54488(%rip), %rbp     # 0x836d0
movq %r15, %rdi
xorl %esi, %esi
callq 0x12910
movq %r14, %rdi
xorl %esi, %esi
callq 0x12570
movq %rbx, %rdi
xorl %esi, %esi
callq 0x12570
callq 0x16a2c
movq %rax, (%r12,%r13)
movq $0x0, (%r12,%rbp)
addq $0x8, %r12
addq $0x30, %rbx
addq $0x30, %r14
addq $0x28, %r15
cmpq $0x8, %r12
je 0x2f248
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x12450
movq %rsp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x12970
cmpq $0x0, (%r14)
jne 0x2f2b6
movq $0x1, (%rsp)
movq (%rsp), %rsi
cmpq $0x3fffff, %rsi         # imm = 0x3FFFFF
ja 0x2f2d5
movq %rsi, %rax
addq %rsi, %rsi
cmpq $0x200000, %rax         # imm = 0x200000
jb 0x2f2c3
movq %rsi, (%rsp)
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x129f0
leaq 0x543f7(%rip), %r13     # 0x836e0
xorl %r14d, %r14d
leaq 0x5c(%rip), %r15        # 0x2f34f
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x126d0
testl %eax, %eax
jne 0x2f332
movq 0x8(%rsp), %rax
movq %rax, (%r13)
incq %r14
addq $0x8, %r13
cmpq $0x1, %r14
je 0x2f2f8
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x28147(%rip), %rsi     # 0x57480
movl $0x3, %edi
xorl %eax, %eax
callq 0x19fb1
movl $0x1, %edi
callq 0x12870
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/bio.c
// Function: bioCreateBackgroundJob
void bioCreateBackgroundJob(int type, void *arg1, void *arg2, void *arg3) {
    struct bio_job *job = zmalloc(sizeof(*job));

    job->time = time(NULL);
    job->arg1 = arg1;
    job->arg2 = arg2;
    job->arg3 = arg3;
    pthread_mutex_lock(&bio_mutex[type]);
    listAddNodeTail(bio_jobs[type],job);
    bio_pending[type]++;
    pthread_cond_signal(&bio_newjob_cond[type]);
    pthread_mutex_unlock(&bio_mutex[type]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
movl $0x20, %edi
callq 0x1fea5
movq %rax, %r12
xorl %edi, %edi
callq 0x12550
movq %rax, (%r12)
movq %r15, 0x8(%r12)
movq %r14, 0x10(%r12)
movq %rbx, 0x18(%r12)
movslq %ebp, %r14
leaq (%r14,%r14,4), %rax
leaq 0x540c6(%rip), %rcx     # 0x835b0
leaq (%rcx,%rax,8), %rbx
movq %rbx, %rdi
callq 0x12960
leaq 0x541c3(%rip), %rax     # 0x836c0
movq (%rax,%r14,8), %rdi
movq %r12, %rsi
callq 0x16aff
leaq 0x541c0(%rip), %rax     # 0x836d0
incq (%rax,%r14,8)
leaq (%r14,%r14,2), %rax
shlq $0x4, %rax
leaq 0x540dd(%rip), %rdi     # 0x83600
addq %rax, %rdi
callq 0x12480
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x125c0
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/bio.c
// Function: bioPendingJobsOfType
unsigned long long bioPendingJobsOfType(int type) {
    unsigned long long val;
    pthread_mutex_lock(&bio_mutex[type]);
    val = bio_pending[type];
    pthread_mutex_unlock(&bio_mutex[type]);
    return val;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movslq %edi, %r14
leaq (%r14,%r14,4), %rax
leaq 0x54063(%rip), %rcx     # 0x835b0
leaq (%rcx,%rax,8), %rbx
movq %rbx, %rdi
callq 0x12960
leaq 0x54170(%rip), %rax     # 0x836d0
movq (%rax,%r14,8), %r14
movq %rbx, %rdi
callq 0x125c0
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/bio.c
// Function: bioWaitStepOfType
unsigned long long bioWaitStepOfType(int type) {
    unsigned long long val;
    pthread_mutex_lock(&bio_mutex[type]);
    val = bio_pending[type];
    if (val != 0) {
        pthread_cond_wait(&bio_step_cond[type],&bio_mutex[type]);
        val = bio_pending[type];
    }
    pthread_mutex_unlock(&bio_mutex[type]);
    return val;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movslq %edi, %r14
leaq (%r14,%r14,4), %rax
leaq 0x54026(%rip), %rcx     # 0x835b0
leaq (%rcx,%rax,8), %rbx
movq %rbx, %rdi
callq 0x12960
leaq 0x54133(%rip), %r15     # 0x836d0
cmpq $0x0, (%r15,%r14,8)
je 0x2f5c4
leaq (%r14,%r14,2), %rax
shlq $0x4, %rax
leaq 0x540ad(%rip), %rdi     # 0x83660
addq %rax, %rdi
movq %rbx, %rsi
callq 0x12200
movq (%r15,%r14,8), %r14
jmp 0x2f5c7
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x125c0
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/bio.c
// Function: bioKillThreads
void bioKillThreads(void) {
    int err, j;

    for (j = 0; j < BIO_NUM_OPS; j++) {
        if (pthread_cancel(bio_threads[j]) == 0) {
            if ((err = pthread_join(bio_threads[j],NULL)) != 0) {
                serverLog(LL_WARNING,
                    "Bio thread for job type #%d can be joined: %s",
                        j, strerror(err));
            } else {
                serverLog(LL_WARNING,
                    "Bio thread for job type #%d terminated",j);
            }
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x540f9(%rip), %r12     # 0x836e0
leaq 0x27f49(%rip), %rbx     # 0x57537
leaq 0x27f14(%rip), %r14     # 0x57509
xorl %r15d, %r15d
movq (%r12), %rdi
callq 0x12900
testl %eax, %eax
jne 0x2f644
movq (%r12), %rdi
xorl %esi, %esi
callq 0x128d0
testl %eax, %eax
je 0x2f632
movl %eax, %edi
callq 0x128f0
movl $0x3, %edi
movq %r14, %rsi
movl %r15d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x19fb1
jmp 0x2f644
movl $0x3, %edi
movq %rbx, %rsi
movl %r15d, %edx
xorl %eax, %eax
callq 0x19fb1
incq %r15
addq $0x8, %r12
cmpq $0x1, %r15
je 0x2f5f8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/memtest.c
// Function: memtest_progress_start
void memtest_progress_start(char *title, int pass) {
    int j;

    printf("\x1b[H\x1b[2J");    /* Cursor home, clear screen. */
    /* Fill with dots. */
    for (j = 0; j < ws.ws_col*(ws.ws_row-2); j++) printf(".");
    printf("Please keep the test running several minutes per GB of memory.\n");
    printf("Also check http://www.memtest86.com/ and http://pyropus.ca/software/memtester/");
    printf("\x1b[H\x1b[2K");          /* Cursor home, clear current line.  */
    printf("%s [%d]\n", title, pass); /* Print title. */
    progress_printed = 0;
    progress_full = ws.ws_col*(ws.ws_row-3);
    fflush(stdout);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
leaq 0x27eee(%rip), %rdi     # 0x5755e
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x122c0
movzwl 0x54072(%rip), %eax     # 0x836f2
movzwl 0x54069(%rip), %ecx     # 0x836f0
addl $-0x2, %ecx
imull %eax, %ecx
testl %ecx, %ecx
jle 0x2f6b5
movl $0x2e, %edi
callq 0x12080
incl %ebp
movzwl 0x5404e(%rip), %eax     # 0x836f2
movzwl 0x54045(%rip), %ecx     # 0x836f0
addl $-0x2, %ecx
imull %eax, %ecx
cmpl %ecx, %ebp
jl 0x2f691
leaq 0x280a5(%rip), %rdi     # 0x57761
callq 0x12160
leaq 0x27e9e(%rip), %rdi     # 0x57566
xorl %eax, %eax
callq 0x122c0
leaq 0x27edf(%rip), %rdi     # 0x575b5
xorl %eax, %eax
callq 0x122c0
leaq 0x27ed9(%rip), %rdi     # 0x575bd
movq %r14, %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x122c0
movq $0x0, 0x53ffd(%rip) # 0x836f8
movzwl 0x53ff0(%rip), %eax     # 0x836f2
movzwl 0x53fe7(%rip), %ecx     # 0x836f0
addl $-0x3, %ecx
imull %eax, %ecx
movslq %ecx, %rax
movq %rax, 0x53fe7(%rip)     # 0x83700
movq 0x3e860(%rip), %rax     # 0x6df80
movq (%rax), %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x125e0
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/memtest.c
// Function: memtest_progress_step
void memtest_progress_step(size_t curr, size_t size, char c) {
    size_t chars = ((unsigned long long)curr*progress_full)/size, j;

    for (j = 0; j < chars-progress_printed; j++) printf("%c",c);
    progress_printed = chars;
    fflush(stdout);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ecx
movq %rdi, %rax
imulq 0x53fb5(%rip), %rax     # 0x83700
xorl %edx, %edx
divq %rsi
movq %rax, %rbx
cmpq 0x53f9e(%rip), %rax     # 0x836f8
je 0x2f77b
movsbl %cl, %ebp
xorl %r14d, %r14d
movl %ebp, %edi
callq 0x12080
incq %r14
movq %rbx, %rax
subq 0x53f82(%rip), %rax     # 0x836f8
cmpq %rax, %r14
jb 0x2f762
movq %rbx, 0x53f76(%rip)     # 0x836f8
movq 0x3e7f7(%rip), %rax     # 0x6df80
movq (%rax), %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x125e0
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/memtest.c
// Function: memtest_addressing
void memtest_addressing(unsigned long *l, size_t bytes) {
    unsigned long words = bytes/sizeof(unsigned long);
    unsigned long j, *p;

    /* Fill */
    p = l;
    for (j = 0; j < words; j++) {
        *p = (unsigned long)p;
        p++;
        if ((j & 0xffff) == 0) memtest_progress_step(j,words*2,'A');
    }
    /* Test */
    p = l;
    for (j = 0; j < words; j++) {
        if (*p != (unsigned long)p) {
            printf("\n*** MEMORY ADDRESSING ERROR: %p contains %lu\n",
                (void*) p, *p);
            exit(1);
        }
        p++;
        if ((j & 0xffff) == 0) memtest_progress_step(j+words,words*2,'A');
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %r13
shrq $0x3, %r13
cmpq $0x8, %rsi
jb 0x2f7e7
leaq (,%r13,2), %r15
xorl %r12d, %r12d
movq %rbx, %rbp
movq %rbp, (%rbx,%r12,8)
testw %r12w, %r12w
jne 0x2f7db
movq %r12, %rdi
movq %r15, %rsi
movl $0x41, %edx
callq 0x2f73a
incq %r12
addq $0x8, %rbp
cmpq %r12, %r13
jne 0x2f7c1
cmpq $0x8, %r14
jb 0x2f82a
leaq (,%r13,2), %r14
xorl %r15d, %r15d
movq %rbx, %r12
movq (%rbx), %rdx
cmpq %rdx, %r12
jne 0x2f839
testw %r15w, %r15w
jne 0x2f81a
leaq (%r15,%r13), %rdi
movq %r14, %rsi
movl $0x41, %edx
callq 0x2f73a
addq $0x8, %rbx
incq %r15
addq $0x8, %r12
cmpq %r15, %r13
jne 0x2f7fb
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x27d86(%rip), %rdi     # 0x575c6
movq %rbx, %rsi
xorl %eax, %eax
callq 0x122c0
movl $0x1, %edi
callq 0x12870
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/memtest.c
// Function: memtest_fill_random
void memtest_fill_random(unsigned long *l, size_t bytes) {
    unsigned long step = 4096/sizeof(unsigned long);
    unsigned long words = bytes/sizeof(unsigned long)/2;
    unsigned long iwords = words/step;  /* words per iteration */
    unsigned long off, w, *l1, *l2;

    assert((bytes & 4095) == 0);
    for (off = 0; off < step; off++) {
        l1 = l+off;
        l2 = l1+words;
        for (w = 0; w < iwords; w++) {
#ifdef MEMTEST_32BIT
            *l1 = *l2 = ((unsigned long)     (rand()&0xffff)) |
                        (((unsigned long)    (rand()&0xffff)) << 16);
#else
            *l1 = *l2 = ((unsigned long)     (rand()&0xffff)) |
                        (((unsigned long)    (rand()&0xffff)) << 16) |
                        (((unsigned long)    (rand()&0xffff)) << 32) |
                        (((unsigned long)    (rand()&0xffff)) << 48);
#endif
            l1 += step;
            l2 += step;
            if ((w & 0xffff) == 0)
                memtest_progress_step(w+iwords*off,words,'R');
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
testl $0xfff, %esi            # imm = 0xFFF
jne 0x2f973
movq %rsi, %rax
shrq $0x4, %rax
movq %rax, 0x20(%rsp)
movq %rsi, %rax
shrq $0xd, %rax
movq %rax, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movq %rsi, 0x30(%rsp)
movl $0xffff, %r15d          # imm = 0xFFFF
cmpq $0x2000, %rsi           # imm = 0x2000
jb 0x2f936
movq 0x28(%rsp), %rax
movq 0x8(%rsp), %rcx
leaq (%rax,%rcx,8), %r14
xorl %ebx, %ebx
callq 0x12980
movl %eax, %ebp
andl %r15d, %ebp
callq 0x12980
movl %eax, %r12d
shll $0x10, %r12d
orl %ebp, %r12d
callq 0x12980
movl %eax, %r13d
andl %r15d, %r13d
shlq $0x20, %r13
orq %r12, %r13
callq 0x12980
shlq $0x30, %rax
orq %r13, %rax
movq 0x20(%rsp), %rcx
movq %rax, (%r14,%rcx,8)
movq %rax, (%r14)
testw %bx, %bx
jne 0x2f925
movq 0x10(%rsp), %rax
leaq (%rax,%rbx), %rdi
movq 0x20(%rsp), %rsi
movl $0x52, %edx
callq 0x2f73a
addq $0x1000, %r14           # imm = 0x1000
incq %rbx
cmpq %rbx, 0x18(%rsp)
jne 0x2f8c5
movq 0x8(%rsp), %rcx
incq %rcx
movq 0x10(%rsp), %rax
addq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
cmpq $0x200, %rcx            # imm = 0x200
movq 0x30(%rsp), %rsi
jne 0x2f8a8
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x27c7b(%rip), %rdi     # 0x575f5
leaq 0x27c88(%rip), %rsi     # 0x57609
leaq 0x27c8b(%rip), %rcx     # 0x57613
movl $0x7c, %edx
callq 0x12350
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/memtest.c
// Function: memtest_fill_value
void memtest_fill_value(unsigned long *l, size_t bytes, unsigned long v1,
                        unsigned long v2, char sym)
{
    unsigned long step = 4096/sizeof(unsigned long);
    unsigned long words = bytes/sizeof(unsigned long)/2;
    unsigned long iwords = words/step;  /* words per iteration */
    unsigned long off, w, *l1, *l2, v;

    assert((bytes & 4095) == 0);
    for (off = 0; off < step; off++) {
        l1 = l+off;
        l2 = l1+words;
        v = (off & 1) ? v2 : v1;
        for (w = 0; w < iwords; w++) {
#ifdef MEMTEST_32BIT
            *l1 = *l2 = ((unsigned long)     v) |
                        (((unsigned long)    v) << 16);
#else
            *l1 = *l2 = ((unsigned long)     v) |
                        (((unsigned long)    v) << 16) |
                        (((unsigned long)    v) << 32) |
                        (((unsigned long)    v) << 48);
#endif
            l1 += step;
            l2 += step;
            if ((w & 0xffff) == 0)
                memtest_progress_step(w+iwords*off,words,sym);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rdi, 0x18(%rsp)
testl $0xfff, %esi            # imm = 0xFFF
jne 0x2fa82
movq %rsi, %r13
shrq $0x4, %r13
movq %rsi, %r15
shrq $0xd, %r15
xorl %r14d, %r14d
movsbl %r8b, %eax
movl %eax, 0x14(%rsp)
movq $0x0, 0x8(%rsp)
movq %rsi, 0x30(%rsp)
cmpq $0x2000, %rsi           # imm = 0x2000
jb 0x2fa51
movq 0x8(%rsp), %rdx
testb $0x1, %dl
movq 0x28(%rsp), %rax
cmoveq 0x20(%rsp), %rax
movq 0x18(%rsp), %rcx
leaq (%rcx,%rdx,8), %rbx
movq %rax, %rcx
movq %rax, %rbp
shlq $0x30, %rbp
orq %rax, %rbp
shlq $0x10, %rax
shlq $0x20, %rcx
orq %rax, %rcx
orq %rcx, %rbp
xorl %r12d, %r12d
movq %rbp, (%rbx,%r13,8)
movq %rbp, (%rbx)
testw %r12w, %r12w
jne 0x2fa42
leaq (%r14,%r12), %rdi
movq %r13, %rsi
movl 0x14(%rsp), %edx
callq 0x2f73a
addq $0x1000, %rbx           # imm = 0x1000
incq %r12
cmpq %r12, %r15
jne 0x2fa25
movq 0x8(%rsp), %rcx
incq %rcx
addq %r15, %r14
movq %rcx, 0x8(%rsp)
cmpq $0x200, %rcx            # imm = 0x200
movq 0x30(%rsp), %rsi
jne 0x2f9e2
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x27b6c(%rip), %rdi     # 0x575f5
leaq 0x27b79(%rip), %rsi     # 0x57609
leaq 0x27bae(%rip), %rcx     # 0x57645
movl $0x9c, %edx
callq 0x12350
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/memtest.c
// Function: memtest_compare
void memtest_compare(unsigned long *l, size_t bytes) {
    unsigned long words = bytes/sizeof(unsigned long)/2;
    unsigned long w, *l1, *l2;

    assert((bytes & 4095) == 0);
    l1 = l;
    l2 = l1+words;
    for (w = 0; w < words; w++) {
        if (*l1 != *l2) {
            printf("\n*** MEMORY ERROR DETECTED: %p != %p (%lu vs %lu)\n",
                (void*)l1, (void*)l2, *l1, *l2);
            exit(1);
        }
        l1 ++;
        l2 ++;
        if ((w & 0xffff) == 0) memtest_progress_step(w,words,'=');
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
testl $0xfff, %r14d           # imm = 0xFFF
jne 0x2fb24
cmpq $0x10, %r14
jb 0x2fafa
movq %rdi, %rbx
shrq $0x4, %r14
leaq (%rdi,%r14,8), %r15
xorl %r12d, %r12d
movq (%rbx), %rcx
movq (%r15), %r8
cmpq %r8, %rcx
jne 0x2fb06
testw %r12w, %r12w
jne 0x2faea
movq %r12, %rdi
movq %r14, %rsi
movl $0x3d, %edx
callq 0x2f73a
addq $0x8, %rbx
addq $0x8, %r15
incq %r12
cmpq %r12, %r14
jne 0x2fac9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x27bbb(%rip), %rdi     # 0x576c8
movq %rbx, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x122c0
movl $0x1, %edi
callq 0x12870
leaq 0x27aca(%rip), %rdi     # 0x575f5
leaq 0x27ad7(%rip), %rsi     # 0x57609
leaq 0x27b61(%rip), %rcx     # 0x5769a
movl $0xb7, %edx
callq 0x12350