LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0x446ae(%rip), %r15     # 0x6a088
movq 0x668(%r15), %rax
movq 0x10(%rax), %rdi
callq 0x14f4c
movq %rax, %r14
movq %r14, %rdi
callq 0x14f5b
testq %rax, %rax
je 0x25a0e
movq 0x8(%rax), %rdi
cmpq 0x58b9b(%rip), %rdi     # 0x7e5a0
je 0x259ed
callq 0x25a7d
jmp 0x259ed
movq %r14, %rdi
callq 0x1501c
callq 0x25933
testl %ebx, %ebx
je 0x25a67
movq 0x58b7a(%rip), %rdi     # 0x7e5a0
pushq $0x28
popq %rsi
callq 0x19398
movq %rax, %rbx
movq 0x668(%r15), %rax
movq 0x10(%rax), %rdi
movq %rbx, %rsi
callq 0x14b54
movq %rbx, %rdi
callq 0x19548
movq 0x58b4d(%rip), %rdi     # 0x7e5a0
pushq $0x28
popq %rsi
callq 0x1f624
movq 0x58b3e(%rip), %rdi     # 0x7e5a0
callq 0x2534c
callq 0x1609c
movq 0x668(%r15), %rax
orl $0x7, 0x28(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x445fd(%rip), %rax     # 0x6a088
movq 0x668(%rax), %rax
movq 0x10(%rax), %rdi
callq 0x14f4c
movq %rax, %r14
movq %r14, %rdi
callq 0x14f5b
testq %rax, %rax
je 0x25abe
movq 0x8(%rax), %rdi
cmpq %rbx, %rdi
je 0x25a9e
movq %rbx, %rsi
callq 0x25dc3
jmp 0x25a9e
movq %r14, %rdi
callq 0x1501c
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x25e3c
// File: /workspace/github_c_makefile_star2_O2/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 0x4423e(%rip), %r14     # 0x6a088
movq 0x668(%r14), %rax
movq 0x10(%rax), %rdi
movq %rbx, %rsi
callq 0x14b54
testl %eax, %eax
jne 0x25eb5
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0x25e72
callq 0x25b27
testb $0x8, 0x30(%rbx)
jne 0x25e9a
movq 0x668(%r14), %rax
movq 0x18(%rax), %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x148e3
orb $0x40, 0x30(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x90(%rbx), %rdi
callq 0x12b0a
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1ac81
leaq 0x2a5d2(%rip), %rdi     # 0x5048e
leaq 0x2a2b6(%rip), %rsi     # 0x50179
movl $0x27f, %edx            # imm = 0x27F
callq 0x240ca
pushq $0x1
popq %rdi
callq 0x12120
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x28
popq %rsi
callq 0x19398
movq %rax, %rbx
callq 0x25f75
leaq 0x4409c(%rip), %r14     # 0x6a088
movq 0x668(%r14), %rax
movq 0x20(%rax), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x148e3
testl %eax, %eax
jne 0x26010
movq %rbx, %rdi
callq 0x194fb
movq %rax, %rbx
movq 0x668(%r14), %rax
movq 0x20(%rax), %rdi
movq %rbx, %rsi
callq 0x14dd3
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 0x19548
// File: /workspace/github_c_makefile_star2_O2/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 0x260ff
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x43fe4(%rip), %r14     # 0x6a088
movq 0x668(%r14), %rax
movl 0xc(%rax), %eax
pushq $0x2
popq %rcx
cltd
idivl %ecx
movl %eax, %ebp
callq 0x25e27
cmpl %ebp, %eax
jl 0x260fb
leaq 0x2a41c(%rip), %rsi     # 0x504e2
pushq $0x1
popq %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x15b9e
movl 0x30(%rbx), %eax
andl $-0x4, %eax
orl $0x2, %eax
movl %eax, 0x30(%rbx)
callq 0x15db3
movq %rax, 0x48(%rbx)
movq %rbx, %rdi
callq 0x26100
movq 0x668(%r14), %rax
orl $0x3, 0x28(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, %rbx
movq %rsp, %r14
pushq $0x3
popq %rsi
movq %r14, %rdi
callq 0x26fb4
movq 0x20(%rbx), %rax
movq %rax, 0x80(%r14)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movaps %xmm1, 0x70(%r14)
movaps %xmm0, 0x60(%r14)
leaq 0x43f4a(%rip), %rax     # 0x6a088
movq 0x668(%rax), %rax
movq 0x10(%rax), %rdi
movl 0x4(%r14), %edx
bswapl %edx
movq %r14, %rsi
callq 0x26f65
addq $0xc8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x26198
movq %rdi, %rbx
leaq 0x2a3b0(%rip), %rsi     # 0x50523
pushq $0x1
popq %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x15b9e
andb $-0x3, 0x30(%rbx)
leaq 0x43efd(%rip), %rax     # 0x6a088
movq 0x668(%rax), %rax
orl $0x3, 0x28(%rax)
popq %rbx
retq
leaq 0x2a373(%rip), %rdi     # 0x50512
leaq 0x29fd3(%rip), %rsi     # 0x50179
movl $0x344, %edx            # imm = 0x344
callq 0x240ca
pushq $0x1
popq %rdi
callq 0x12120
// File: /workspace/github_c_makefile_star2_O2/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)
xorl %r14d, %r14d
cmpq %rsi, 0x88(%rdi)
je 0x2653c
movl %edx, %ebp
movq %rdi, %rbx
movq %rsp, %rdi
callq 0x2647e
cmpl %ebp, 0x80(%rbx)
jne 0x264df
leaq 0x50(%rbx), %rsi
movq %rsp, %rdi
callq 0x12490
testl %eax, %eax
je 0x2653c
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 0x2651a
callq 0x25b27
movl 0x80(%rbx), %ebp
andb $-0x11, 0x30(%rbx)
leaq 0x2a096(%rip), %rsi     # 0x505bb
pushq $0x3
popq %rdi
movq %rbx, %rdx
movq %r14, %rcx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x15b9e
pushq $0x1
popq %r14
movl %r14d, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x19398
movq %rax, %r14
movl 0x18(%r12), %eax
movl %eax, 0x2c(%rsp)
movq (%r12), %r15
movq 0x8(%r12), %rdi
pushq $0x40
popq %rbp
pushq $0xb
popq %r13
movl %ebp, %esi
movl %r13d, %edx
callq 0x27e30
fstpt 0x30(%rsp)
movq 0x10(%r12), %rdi
movl %ebp, %esi
movl %r13d, %edx
callq 0x27e30
fld %st(0)
fstpt 0x3c(%rsp)
fstpt 0x10(%rsp)
fldt 0x30(%rsp)
fstpt (%rsp)
leaq 0x29d53(%rip), %rsi     # 0x50a5e
xorl %edi, %edi
movq %r14, %rdx
movq %rbx, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x15b9e
movq %r14, %rdi
callq 0x29e0b
testq %rax, %rax
je 0x26d5a
movq %rax, %r12
movq 0x8(%rax), %rdi
leaq 0x48(%rsp), %rbp
movq %rbp, %rsi
callq 0x12d0c
xorl %r13d, %r13d
movq %rbp, %rdi
callq 0x12d26
testq %rax, %rax
je 0x26d67
movq 0x10(%rax), %r13
cmpq %rbx, (%r13)
jne 0x26d41
jmp 0x26d83
movq %r14, %rdi
callq 0x29e31
movq %rax, %r12
jmp 0x26d72
testq %r13, %r13
je 0x26d72
cmpq %rbx, (%r13)
je 0x26d83
movq %r12, %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x29ec0
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 0x2c(%rsp), %esi
movq %r14, %rdx
callq 0x27bd5
leaq 0x432d5(%rip), %rax     # 0x6a088
incq 0x6a0(%rax)
movq %r14, %rdi
callq 0x19548
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x19398
movq %rax, %rbx
movl (%r15), %ebp
movq %rax, %rdi
callq 0x29e0b
testq %rax, %rax
je 0x26e14
movl 0x38(%rax), %r9d
cmpl %ebp, %r9d
jne 0x26e2d
movq %rax, %rdi
movq %r14, %rsi
callq 0x29d69
jmp 0x26e46
leaq 0x29cd9(%rip), %rsi     # 0x50af4
pushq $0x1
popq %rdi
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x15b9e
jmp 0x26e46
leaq 0x29c8d(%rip), %rsi     # 0x50ac1
pushq $0x1
popq %rdi
movq %r14, %rdx
movl %ebp, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0x15b9e
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x19548
// File: /workspace/github_c_makefile_star2_O2/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 0x14f4c
movq %rax, %r15
movq %r15, %rdi
callq 0x14f5b
testq %rax, %rax
je 0x26fa7
movq (%rax), %rax
movq 0x88(%rax), %rdi
testq %rdi, %rdi
je 0x26f78
testb $0xc, 0x30(%rax)
jne 0x26f78
movq %r14, %rsi
movq %rbx, %rdx
callq 0x26eea
jmp 0x26f78
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1501c
// File: /workspace/github_c_makefile_star2_O2/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 0x575bd(%rip), %rax     # 0x7e5a0
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm0, 0x10(%rbx)
movups %xmm1, 0x20(%rbx)
movq 0x20(%rax), %rcx
movq %rcx, 0x30(%rbx)
leaq 0x43087(%rip), %rcx     # 0x6a088
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_O2/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 0x42c9e(%rip), %rbx     # 0x6a088
movq 0x668(%rbx), %rax
movl 0x28(%rax), %edi
testb $0x1, %dil
je 0x27409
callq 0x258db
movq 0x668(%rbx), %rax
movl 0x28(%rax), %edi
testb $0x2, %dil
je 0x2741e
andl $0x4, %edi
callq 0x25562
movq 0x668(%rbx), %rax
andl $0x0, 0x28(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x27462
movl %esi, %ebp
pushq $0x8
popq %r14
leaq 0x3fe41(%rip), %r15     # 0x67280
cmpq $0x58, %r14
je 0x27474
testw %bp, -0x8(%r14,%r15)
je 0x2745c
movq (%r14,%r15), %rsi
movq %rbx, %rdi
callq 0x19b37
movq %rax, %rbx
addq $0x10, %r14
jmp 0x2743f
leaq 0x293a9(%rip), %rsi     # 0x50812
movq %rbx, %rdi
callq 0x19b37
movq %rax, %rbx
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0x19894
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x194cc
leaq 0x50(%rbx), %rcx
movl 0x80(%rbx), %r8d
leaq 0x29373(%rip), %rsi     # 0x5081b
movq %rax, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x19db8
movzwl 0x30(%rbx), %esi
movq %rax, %rdi
callq 0x27424
movq 0x38(%rbx), %rdx
movq 0x40(%rbx), %rcx
cmpq $0x0, 0x88(%rbx)
je 0x274dc
leaq 0x2935f(%rip), %r8      # 0x50839
jmp 0x274f2
testb $0x4, 0x30(%rbx)
leaq 0x2934f(%rip), %rsi     # 0x50836
leaq 0x2934b(%rip), %r8      # 0x50839
cmoveq %rsi, %r8
leaq 0x2932f(%rip), %rsi     # 0x50828
movq %rax, %rdi
xorl %eax, %eax
popq %rbx
jmp 0x19db8
// File: /workspace/github_c_makefile_star2_O2/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 0x42b78(%rip), %rbx     # 0x6a088
movq 0x668(%rbx), %rax
movl 0x38(%rax), %r14d
cmpl $0x2, %r14d
jl 0x2755e
leaq -0x1(%r14), %r15
callq 0x12970
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)
movq %r15, %r14
jmp 0x2751b
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x42760(%rip), %r15     # 0x6a088
movq 0x668(%r15), %rax
movq 0x10(%rax), %rdi
callq 0x14f27
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 0x1d03d
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x1d00a
movq 0x56c30(%rip), %rsi     # 0x7e5a0
pushq $0x28
popq %rdx
movq %rbx, %rdi
callq 0x1d103
pushq $0x64
popq %r12
pushq $0x4
popq %r13
movq %r14, %rdi
callq 0x14f5b
testq %rax, %rax
je 0x27a1a
movq 0x8(%rax), %rbp
cmpq $0x0, 0x88(%rbp)
pushq $0x1
popq %r15
jne 0x279c4
leaq 0x426db(%rip), %rax     # 0x6a088
movq 0x668(%rax), %rax
xorl %ecx, %ecx
cmpq (%rax), %rbp
setne %cl
leaq 0x1(,%rcx,4), %r15
movl 0x30(%rbp), %eax
testb $0x1, %al
pushq $0xa
popq %rcx
cmovneq %rcx, %r15
testb $0x2, %al
cmovneq %r12, %r15
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1d03d
movq %rbx, %rdi
movq %rbp, %rsi
pushq $0x28
popq %rdx
callq 0x1d103
leaq 0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0x1ce65
movslq 0x80(%rbp), %rsi
movq %rbx, %rdi
callq 0x1d19d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1d19d
jmp 0x27983
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1501c
// File: /workspace/github_c_makefile_star2_O2/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterSendShardToNode
void clusterSendShardToNode(counter *cntr, clusterNode *node) {
    unsigned char buf[sizeof(clusterMsg) + 64], *payload;
    clusterMsg *hdr = (clusterMsg*) buf;
    uint32_t totlen;

    if (node->link == NULL) return;

    totlen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
    totlen += sizeof(clusterMsgDataCounter) - sizeof(hdr->data.counter.shard.name);
    totlen += sdslen(cntr->name);

    clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_COUNTER);
    hdr->totlen = htonl(totlen);

    hdr->data.counter.shard.revision       = intrev32ifbe(cntr->revision);
    hdr->data.counter.shard.predict_time   = intrev64ifbe(cntr->myshard->predict_time);
    hdr->data.counter.shard.predict_value  = intrev64ifbe(pack754(cntr->myshard->predict_value, 64, 11));
    hdr->data.counter.shard.predict_change = intrev64ifbe(pack754(cntr->myshard->predict_change, 64, 11));
    hdr->data.counter.shard.name_length    = intrev16ifbe(sdslen(cntr->name));

    if (totlen < sizeof(buf)) {
        payload = buf;
    } else {
        payload = zmalloc(totlen);
        memcpy(payload,buf,sizeof(clusterMsg));
        hdr = (clusterMsg*) payload;

        serverLog(LL_DEBUG,"Need to resize payload buffer to %u bytes for counter for %s",
            totlen, cntr->name);
    }

    memcpy(hdr->data.counter.shard.name, cntr->name, sdslen(cntr->name));

    clusterSendMessage(node->link,payload,totlen);

    if (totlen >= sizeof(buf)) {
        zfree(payload);
    }
}

// Assembly:
cmpq $0x0, 0x88(%rsi)
je 0x27b67
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rsi, %rbx
movq %rdi, %r12
movq (%rdi), %rdi
callq 0x2552a
movq %rax, %r14
addl $0x7e, %r14d
leaq 0x10(%rsp), %r15
pushq $0x4
popq %rsi
movq %r15, %rdi
callq 0x26fb4
movl %r14d, %eax
bswapl %eax
movl %eax, 0x4(%r15)
movl 0x38(%r12), %eax
movl %eax, 0x78(%r15)
movq 0x10(%r12), %rax
movq 0x40(%rax), %rcx
movq %rcx, 0x60(%r15)
fldt 0x50(%rax)
fstpt (%rsp)
pushq $0x40
popq %rbp
pushq $0xb
popq %r13
movl %ebp, %edi
movl %r13d, %esi
callq 0x27d56
movq %rax, 0x68(%r15)
movq 0x10(%r12), %rax
fldt 0x60(%rax)
fstpt (%rsp)
movl %ebp, %edi
movl %r13d, %esi
callq 0x27d56
movq %rax, 0x70(%r15)
movq (%r12), %r13
movq %r13, %rdi
callq 0x2552a
movw %ax, 0x7c(%r15)
cmpl $0x108, %r14d           # imm = 0x108
jb 0x27b19
movq %r14, %rdi
callq 0x1ab29
movq %rax, %r15
leaq 0x10(%rsp), %rsi
movl $0xc8, %edx
movq %rax, %rdi
callq 0x12510
movq (%r12), %rcx
leaq 0x28f18(%rip), %rsi     # 0x50a21
xorl %edi, %edi
movl %r14d, %edx
xorl %eax, %eax
callq 0x15b9e
movq (%r12), %r13
leaq 0x7e(%r15), %r12
movq %r13, %rdi
callq 0x2552a
movq %r12, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x12510
movq 0x88(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x26eea
cmpl $0x108, %r14d           # imm = 0x108
jb 0x27b56
movq %r15, %rdi
callq 0x1ac81
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x29d10
leaq 0x4250c(%rip), %rax     # 0x6a088
movq 0x668(%rax), %rax
movq 0x10(%rax), %rdi
callq 0x14f27
movq %rax, %r14
movq %r14, %rdi
callq 0x14f5b
testq %rax, %rax
je 0x27bc8
movq 0x8(%rax), %r15
cmpq 0x569f9(%rip), %r15     # 0x7e5a0
je 0x27b8f
testb $0x8, 0x30(%r15)
jne 0x27b8f
movq %rbx, %rdi
movq %r15, %rsi
callq 0x29d39
movq %rbx, %rdi
movq %r15, %rsi
callq 0x27a30
jmp 0x27b8f
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1501c
// File: /workspace/github_c_makefile_star2_O2/erikdubbelboer[P]discnt/src/cluster.c
// Function: clusterSendAck
void clusterSendAck(clusterNode *node, uint32_t revision, const sds name) {
    unsigned char buf[sizeof(clusterMsg) + 64], *payload;
    clusterMsg *hdr = (clusterMsg*) buf;
    uint32_t totlen;

    if (node->link == NULL) return;

    totlen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
    totlen += sizeof(clusterMsgDataAck) - sizeof(hdr->data.ack.about.name);
    totlen += sdslen(name);

    clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_ACK);
    hdr->totlen = htonl(totlen);

    hdr->data.ack.about.revision    = intrev32ifbe(revision);
    hdr->data.ack.about.name_length = intrev16ifbe(sdslen(name));

    if (totlen < sizeof(buf)) {
        payload = buf;
    } else {
        payload = zmalloc(totlen);
        memcpy(payload,buf,sizeof(clusterMsg));
        hdr = (clusterMsg*) payload;

        serverLog(LL_DEBUG,"Need to resize payload buffer to %u bytes for ack for %s",
            totlen, name);
    }

    memcpy(hdr->data.ack.about.name, name, sdslen(name));

    clusterSendMessage(node->link,payload,totlen);

    if (totlen >= sizeof(buf)) {
        zfree(payload);
    }
}

// Assembly:
cmpq $0x0, 0x88(%rdi)
je 0x27cbf
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %rbx
movq %rdx, %rdi
callq 0x2552a
movq %rax, %r14
addl $0x66, %r14d
movq %rsp, %r12
pushq $0x5
popq %rsi
movq %r12, %rdi
callq 0x26fb4
movl %r14d, %eax
bswapl %eax
movl %eax, 0x4(%r12)
movl %ebp, 0x60(%r12)
movq %r15, %rdi
callq 0x2552a
movw %ax, 0x64(%r12)
cmpl $0x108, %r14d           # imm = 0x108
jb 0x27c70
movq %r14, %rdi
callq 0x1ab29
movq %rax, %r12
movq %rsp, %rsi
movl $0xc8, %edx
movq %rax, %rdi
callq 0x12510
leaq 0x28e27(%rip), %rsi     # 0x50a88
xorl %edi, %edi
movl %r14d, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0x15b9e
leaq 0x66(%r12), %r13
movq %r15, %rdi
callq 0x2552a
movq %r13, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x12510
movq 0x88(%rbx), %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x26eea
cmpl $0x108, %r14d           # imm = 0x108
jb 0x27cae
movq %r12, %rdi
callq 0x1ac81
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x6
popq %rsi
movq %rbx, %rdi
callq 0x26fb4
leaq 0x423ab(%rip), %rax     # 0x6a088
movq 0x668(%rax), %rax
movq 0x10(%rax), %rdi
movl 0x4(%rbx), %edx
bswapl %edx
movq %rbx, %rsi
callq 0x26f65
addq $0xd0, %rsp
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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)
fldz
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
jne 0x27d6b
jp 0x27d6b
fstp %st(0)
xorl %eax, %eax
retq
movl %esi, %edx
notl %edx
addl %edi, %edx
fld %st(0)
fchs
fucomi %st(1), %st
fld %st(1)
fcmovnbe %st(1), %st
fstp %st(1)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
flds 0x28dbc(%rip)           # 0x50b44
fxch %st(1)
fucomi %st(1), %st
jb 0x27d9a
fmuls 0x28db4(%rip)           # 0x50b48
incl %eax
fxch %st(1)
jmp 0x27d88
fstp %st(1)
fld1
fucomi %st(1), %st
jbe 0x27dac
fxch %st(1)
fadd %st, %st(0)
decl %eax
fxch %st(1)
jmp 0x27d9e
fstp %st(0)
fldz
xorl %r8d, %r8d
fucompi %st(2), %st
fstp %st(1)
seta %r8b
movabsq $0x1, %r9
movl %edx, %ecx
shlq %cl, %r9
cvtsi2ss %r9, %xmm0
fld1
fchs
addss 0x28d6d(%rip), %xmm0    # 0x50b48
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
subl %r9d, %eax
cltq
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_O2/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 0x27eef
fstp %st(0)
movl %edx, %eax
notl %eax
addl %esi, %eax
movabsq $0x1, %r8
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 0x28ce0(%rip), %rcx     # 0x50b50
fadds (%rcx,%r9,4)
movq %r8, -0x10(%rsp)
fildll -0x10(%rsp)
fdivrp %st, %st(1)
fld1
leal -0x1(%rdx), %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
shll %cl, %r8d
faddp %st, %st(1)
notl %r8d
movq %rdi, %r9
movl %eax, %ecx
shrq %cl, %r9
movabsq $-0x1, %rax
movl %edx, %ecx
shlq %cl, %rax
notq %rax
andq %r9, %rax
subq %r8, %rax
movq %rax, %rcx
testq %rcx, %rcx
jle 0x27ec1
fadd %st, %st(0)
decq %rcx
jmp 0x27eb5
movq %rax, %rcx
sarq $0x3f, %rcx
andq %rax, %rcx
negq %rcx
subq $0x1, %rcx
jb 0x27edc
fmuls 0x28c6e(%rip)           # 0x50b48
jmp 0x27ece
decb %sil
movzbl %sil, %eax
btq %rax, %rdi
fld %st(0)
fchs
fcmovnb %st(1), %st
fstp %st(1)
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x20
popq %rdi
callq 0x1ab29
movq %rax, %r12
xorl %edi, %edi
callq 0x12540
movq %rax, (%r12)
movq %r15, 0x8(%r12)
movq %r14, 0x10(%r12)
movq %rbx, 0x18(%r12)
movslq %ebp, %r14
imulq $0x28, %r14, %rax
leaq 0x56407(%rip), %rbx     # 0x7e5b0
addq %rax, %rbx
movq %rbx, %rdi
callq 0x12950
leaq 0x56505(%rip), %rax     # 0x7e6c0
movq (%rax,%r14,8), %rdi
movq %r12, %rsi
callq 0x12bac
leaq 0x56502(%rip), %rax     # 0x7e6d0
incq (%rax,%r14,8)
imulq $0x30, %r14, %rax
leaq 0x56423(%rip), %rdi     # 0x7e600
addq %rax, %rdi
callq 0x12470
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x125b0
// File: /workspace/github_c_makefile_star2_O2/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
imulq $0x28, %r14, %rax
leaq 0x5636d(%rip), %rbx     # 0x7e5b0
addq %rax, %rbx
movq %rbx, %rdi
callq 0x12950
leaq 0x5647b(%rip), %r15     # 0x7e6d0
cmpq $0x0, (%r15,%r14,8)
je 0x28278
imulq $0x30, %r14, %rax
leaq 0x563f9(%rip), %rdi     # 0x7e660
addq %rax, %rdi
movq %rbx, %rsi
callq 0x12200
movq (%r15,%r14,8), %r14
jmp 0x2827b
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x125b0
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
shrq $0x3, %r14
leaq (%r14,%r14), %r15
xorl %r12d, %r12d
pushq $0x41
popq %rbp
movq %rdi, %r13
cmpq %r12, %r14
je 0x28477
movq %r13, (%rbx,%r12,8)
testw %r12w, %r12w
jne 0x2846e
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x283dd
incq %r12
addq $0x8, %r13
jmp 0x28452
xorl %r12d, %r12d
pushq $0x41
popq %rbp
movq %rbx, %r13
cmpq %r12, %r14
je 0x284ae
movq (%rbx), %rdx
cmpq %rdx, %r13
jne 0x284bd
testw %r12w, %r12w
jne 0x284a1
leaq (%r14,%r12), %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x283dd
addq $0x8, %rbx
incq %r12
addq $0x8, %r13
jmp 0x28480
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x287da(%rip), %rdi     # 0x50c9e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x122c0
pushq $0x1
popq %rdi
callq 0x12860
// File: /workspace/github_c_makefile_star2_O2/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 $0x28, %rsp
movq %rsi, %rbp
movq %rdi, 0x18(%rsp)
testw $0xfff, %bp             # imm = 0xFFF
jne 0x285c6
movq %rbp, %rax
shrq $0x4, %rax
movq %rax, 0x10(%rsp)
shrq $0xd, %rbp
movq $0x0, 0x8(%rsp)
xorl %ecx, %ecx
movl $0xffff, %r15d          # imm = 0xFFFF
cmpq $0x200, %rcx            # imm = 0x200
je 0x285b7
movq 0x18(%rsp), %rax
movq %rcx, 0x20(%rsp)
leaq (%rax,%rcx,8), %r14
xorl %ebx, %ebx
cmpq %rbx, %rbp
je 0x285a5
callq 0x12970
movl %eax, %r12d
andl %r15d, %r12d
callq 0x12970
movl %eax, %r13d
shll $0x10, %r13d
orl %r12d, %r13d
callq 0x12970
movl %eax, %r12d
andl %r15d, %r12d
shlq $0x20, %r12
orq %r13, %r12
callq 0x12970
shlq $0x30, %rax
orq %r12, %rax
movq 0x10(%rsp), %rcx
movq %rax, (%r14,%rcx,8)
movq %rax, (%r14)
testw %bx, %bx
jne 0x28599
movq 0x8(%rsp), %rax
leaq (%rax,%rbx), %rdi
movq 0x10(%rsp), %rsi
pushq $0x52
popq %rdx
callq 0x283dd
addq $0x1000, %r14           # imm = 0x1000
incq %rbx
jmp 0x28535
movq 0x20(%rsp), %rcx
incq %rcx
addq %rbp, 0x8(%rsp)
jmp 0x28518
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x28700(%rip), %rdi     # 0x50ccd
leaq 0x2870d(%rip), %rsi     # 0x50ce1
leaq 0x28710(%rip), %rcx     # 0x50ceb
pushq $0x7c
popq %rdx
callq 0x12350
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
testw $0xfff, %r14w           # imm = 0xFFF
jne 0x28745
movq %rdi, %rbx
shrq $0x4, %r14
xorl %r15d, %r15d
pushq $0x3d
popq %rbp
cmpq %r15, %r14
je 0x2871d
movq (%rbx), %rcx
movq (%rbx,%r14,8), %r8
cmpq %r8, %rcx
jne 0x28728
testw %r15w, %r15w
jne 0x28714
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x283dd
addq $0x8, %rbx
incq %r15
jmp 0x286f0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq (%rbx,%r14,8), %rdx
leaq 0x2866d(%rip), %rdi     # 0x50da0
movq %rbx, %rsi
xorl %eax, %eax
callq 0x122c0
pushq $0x1
popq %rdi
callq 0x12860
leaq 0x28581(%rip), %rdi     # 0x50ccd
leaq 0x2858e(%rip), %rsi     # 0x50ce1
leaq 0x28618(%rip), %rcx     # 0x50d72
movl $0xb7, %edx
callq 0x12350
// File: /workspace/github_c_makefile_star2_O2/erikdubbelboer[P]discnt/src/memtest.c
// Function: memtest_compare_times
void memtest_compare_times(unsigned long *m, size_t bytes, int pass, int times) {
    int j;

    for (j = 0; j < times; j++) {
        memtest_progress_start("Compare",pass);
        memtest_compare(m,bytes);
        memtest_progress_end();
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
xorl %ebp, %ebp
testl %ecx, %ecx
cmovgl %ecx, %ebp
leaq 0x28651(%rip), %r12     # 0x50dd3
subl $0x1, %ebp
jb 0x287a3
movq %r12, %rdi
movl %ebx, %esi
callq 0x28310
movq %r15, %rdi
movq %r14, %rsi
callq 0x286d1
callq 0x283cf
jmp 0x28782
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/erikdubbelboer[P]discnt/src/memtest.c
// Function: memtest_test
void memtest_test(size_t megabytes, int passes) {
    size_t bytes = megabytes*1024*1024;
    unsigned long *m = malloc(bytes);
    int pass = 0;

    if (m == NULL) {
        fprintf(stderr,"Unable to allocate %zu megabytes: %s",
            megabytes, strerror(errno));
        exit(1);
    }
    while (pass != passes) {
        pass++;

        memtest_progress_start("Addressing test",pass);
        memtest_addressing(m,bytes);
        memtest_progress_end();

        memtest_progress_start("Random fill",pass);
        memtest_fill_random(m,bytes);
        memtest_progress_end();
        memtest_compare_times(m,bytes,pass,4);

        memtest_progress_start("Solid fill",pass);
        memtest_fill_value(m,bytes,0,(unsigned long)-1,'S');
        memtest_progress_end();
        memtest_compare_times(m,bytes,pass,4);

        memtest_progress_start("Checkerboard fill",pass);
        memtest_fill_value(m,bytes,ULONG_ONEZERO,ULONG_ZEROONE,'C');
        memtest_progress_end();
        memtest_compare_times(m,bytes,pass,4);
    }
    free(m);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r12
movq %rdi, %r14
shlq $0x14, %r14
movq %r14, %rdi
callq 0x125c0
testq %rax, %rax
je 0x288de
movq %rax, %r15
negl %ebx
pushq $0x1
popq %r12
pushq $0x4
popq %r13
pushq $0x43
popq %rbp
leal (%rbx,%r12), %eax
cmpl $0x1, %eax
je 0x288c8
leaq 0x28608(%rip), %rdi     # 0x50e00
movl %r12d, %esi
callq 0x28310
movq %r15, %rdi
movq %r14, %rsi
callq 0x28430
callq 0x283cf
leaq 0x285f9(%rip), %rdi     # 0x50e10
movl %r12d, %esi
callq 0x28310
movq %r15, %rdi
movq %r14, %rsi
callq 0x284d6
callq 0x283cf
movq %r15, %rdi
movq %r14, %rsi
movl %r12d, %edx
movl %r13d, %ecx
callq 0x28764
leaq 0x285d5(%rip), %rdi     # 0x50e1c
movl %r12d, %esi
callq 0x28310
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
pushq $-0x1
popq %rcx
pushq $0x53
popq %r8
callq 0x285e3
callq 0x283cf
movq %r15, %rdi
movq %r14, %rsi
movl %r12d, %edx
movl %r13d, %ecx
callq 0x28764
leaq 0x285a7(%rip), %rdi     # 0x50e27
movl %r12d, %esi
callq 0x28310
movq %r15, %rdi
movq %r14, %rsi
movabsq $-0x5555555555555556, %rdx # imm = 0xAAAAAAAAAAAAAAAA
movabsq $0x5555555555555555, %rcx # imm = 0x5555555555555555
movl %ebp, %r8d
callq 0x285e3
callq 0x283cf
movq %r15, %rdi
movq %r14, %rsi
movl %r12d, %edx
movl %r13d, %ecx
callq 0x28764
incl %r12d
jmp 0x287e4
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x12070
movq 0x4070b(%rip), %rax     # 0x68ff0
movq (%rax), %rbx
callq 0x120d0
movl (%rax), %edi
callq 0x128e0
leaq 0x284e0(%rip), %rsi     # 0x50ddb
movq %rbx, %rdi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x124c0
pushq $0x1
popq %rdi
callq 0x12860
// File: /workspace/github_c_makefile_star2_O2/erikdubbelboer[P]discnt/src/memtest.c
// Function: memtest_non_destructive_invert
void memtest_non_destructive_invert(void *addr, size_t size) {
    volatile unsigned long *p = addr;
    size_t words = size / sizeof(unsigned long);
    size_t j;

    /* Invert */
    for (j = 0; j < words; j++)
        p[j] = ~p[j];
}

// Assembly:
shrq $0x3, %rsi
xorl %eax, %eax
cmpq %rax, %rsi
je 0x28927
notq (%rdi,%rax,8)
incq %rax
jmp 0x28919
retq