LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/server.c
// Function: sigShutdownHandler
static void sigShutdownHandler(int sig) {
    char *msg;

    switch (sig) {
    case SIGINT:
        msg = "Received SIGINT scheduling shutdown...";
        break;
    case SIGTERM:
        msg = "Received SIGTERM scheduling shutdown...";
        break;
    default:
        msg = "Received shutdown signal, scheduling shutdown...";
    };

    /* SIGINT is often delivered via Ctrl+C in an interactive session.
     * If we receive the signal the second time, we interpret this as
     * the user really wanting to quit ASAP without waiting to persist
     * on disk. */
    if (server.shutdown_asap && sig == SIGINT) {
        serverLogFromHandler(LL_WARNING, "You insist... exiting now.");
        ddbRemoveTempFile(getpid());
        exit(1); /* Exit with an error since this was not a clean shutdown. */
    } else if (server.loading) {
        exit(0);
    }

    serverLogFromHandler(LL_WARNING, msg);
    server.shutdown_asap = 1;
}

// Assembly:
pushq %rax
cmpl $0x2, %edi
jne 0x1d502
cmpl $0x0, 0x51bc8(%rip)     # 0x6f0c8
jne 0x1d544
cmpl $0x0, 0x51e9f(%rip)     # 0x6f3a8
jne 0x1d56b
cmpl $0xf, %edi
leaq 0x36cdb(%rip), %rax     # 0x541f0
leaq 0x36cfc(%rip), %rcx     # 0x54218
cmoveq %rax, %rcx
cmpl $0x2, %edi
leaq 0x36c9f(%rip), %rsi     # 0x541c9
cmovneq %rcx, %rsi
movl $0x3, %edi
callq 0x1a06c
movl $0x1, 0x51b86(%rip)     # 0x6f0c8
popq %rax
retq
leaq 0x36cfe(%rip), %rsi     # 0x54249
movl $0x3, %edi
callq 0x1a06c
callq 0x121f0
movl %eax, %edi
callq 0x33394
movl $0x1, %edi
callq 0x12870
xorl %edi, %edi
callq 0x12870
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/server.c
// Function: loadDataFromDisk
void loadDataFromDisk(void) {
  long long start = ustime();
  if (ddbLoad(server.ddb_filename) == C_OK) {
    serverLog(LL_NOTICE,"DB loaded from disk: %.3f seconds",
        (float)(ustime()-start)/1000000);
  } else if (errno != ENOENT) {
    serverLog(LL_WARNING,"Fatal error loading the DB: %s. Exiting.",strerror(errno));
    exit(1);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsp, %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x12340
movq (%rbx), %r15
movq 0x8(%rbx), %r14
movq 0x521ba(%rip), %rdi     # 0x6f750
callq 0x33700
testl %eax, %eax
je 0x1d5b5
callq 0x120d0
movl (%rax), %edi
cmpl $0x2, %edi
jne 0x1d606
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rsp, %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x12340
movq (%rbx), %rax
subq %r15, %rax
movq 0x8(%rbx), %rcx
subq %r14, %rcx
imulq $0xf4240, %rax, %rax    # imm = 0xF4240
addq %rcx, %rax
cvtsi2ss %rax, %xmm0
divss 0x34e9e(%rip), %xmm0    # 0x52484
cvtss2sd %xmm0, %xmm0
leaq 0x367d7(%rip), %rsi     # 0x53dc8
movl $0x2, %edi
movb $0x1, %al
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x19fb1
callq 0x128f0
leaq 0x367d8(%rip), %rsi     # 0x53dea
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x19fb1
movl $0x1, %edi
callq 0x12870
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/server.c
// Function: serverSetProcTitle
void serverSetProcTitle(char *title) {
#ifdef USE_SETPROCTITLE
    setproctitle("%s %s:%d",
        title,
        server.bindaddr_count ? server.bindaddr[0] : "*",
        server.port);
#else
    UNUSED(title);
#endif
}

// Assembly:
movq %rdi, %rsi
cmpl $0x0, 0x51b5a(%rip)     # 0x6f1c8
je 0x1d679
movq 0x51ad1(%rip), %rdx     # 0x6f148
jmp 0x1d680
leaq 0x3585d(%rip), %rdx     # 0x52edd
movl 0x51ab6(%rip), %ecx     # 0x6f13c
leaq 0x367ce(%rip), %rdi     # 0x53e5b
xorl %eax, %eax
jmp 0x2ffb4
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/server.c
// Function: serverSupervisedUpstart
int serverSupervisedUpstart(void) {
    const char *upstart_job = getenv("UPSTART_JOB");

    if (!upstart_job) {
        serverLog(LL_WARNING,
                "upstart supervision requested, but UPSTART_JOB not found");
        return 0;
    }

    serverLog(LL_NOTICE, "supervised by upstart, will stop to signal readyness");
    raise(SIGSTOP);
    unsetenv("UPSTART_JOB");
    return 1;
}

// Assembly:
pushq %rbx
leaq 0x367c8(%rip), %rdi     # 0x53e64
callq 0x12050
testq %rax, %rax
je 0x1d6d6
leaq 0x367fc(%rip), %rsi     # 0x53ea9
movl $0x2, %edi
xorl %eax, %eax
callq 0x19fb1
movl $0x13, %edi
callq 0x12060
leaq 0x3679a(%rip), %rdi     # 0x53e64
callq 0x127c0
movl $0x1, %ebx
jmp 0x1d6eb
leaq 0x36793(%rip), %rsi     # 0x53e70
xorl %ebx, %ebx
movl $0x3, %edi
xorl %eax, %eax
callq 0x19fb1
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/server.c
// Function: serverIsSupervised
int serverIsSupervised(int mode) {
    if (mode == SUPERVISED_AUTODETECT) {
        const char *upstart_job = getenv("UPSTART_JOB");
        const char *notify_socket = getenv("NOTIFY_SOCKET");

        if (upstart_job) {
            serverSupervisedUpstart();
        } else if (notify_socket) {
            serverSupervisedSystemd();
        }
    } else if (mode == SUPERVISED_UPSTART) {
        return serverSupervisedUpstart();
    } else if (mode == SUPERVISED_SYSTEMD) {
        return serverSupervisedSystemd();
    }

    return 0;
}

// Assembly:
cmpl $0x3, %edi
je 0x1d694
cmpl $0x2, %edi
je 0x1d6ef
cmpl $0x1, %edi
jne 0x1d8ff
pushq %rbx
leaq 0x36590(%rip), %rdi     # 0x53e64
callq 0x12050
movq %rax, %rbx
leaq 0x365fb(%rip), %rdi     # 0x53ede
callq 0x12050
testq %rbx, %rbx
je 0x1d8f4
callq 0x1d694
jmp 0x1d8fe
testq %rax, %rax
je 0x1d8fe
callq 0x1d6ef
popq %rbx
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/sha1.c
// Function: SHA1Update
void SHA1Update(SHA1_CTX* context, const unsigned char* data, uint32_t len)
{
    uint32_t i, j;

    j = context->count[0];
    if ((context->count[0] += len << 3) < j)
        context->count[1]++;
    context->count[1] += (len>>29);
    j = (j >> 3) & 63;
    if ((j + len) > 63) {
        memcpy(&context->buffer[j], data, (i = 64-j));
        SHA1Transform(context->state, context->buffer);
        for ( ; i + 63 < len; i += 64) {
            SHA1Transform(context->state, &data[i]);
        }
        j = 0;
    }
    else i = 0;
    memcpy(&context->buffer[j], &data[i], len - i);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl 0x14(%rdi), %ebp
leal (,%rbx,8), %eax
addl %ebp, %eax
movl %eax, 0x14(%rdi)
jae 0x21420
incl 0x18(%r15)
movl %ebx, %eax
shrl $0x1d, %eax
addl %eax, 0x18(%r15)
shrl $0x3, %ebp
andl $0x3f, %ebp
leal (%rbx,%rbp), %eax
cmpl $0x40, %eax
jb 0x21488
leaq 0x1c(%r15), %r13
leaq (%r15,%rbp), %rdi
addq $0x1c, %rdi
movl $0x40, %r12d
subl %ebp, %r12d
movq %r14, %rsi
movq %r12, %rdx
callq 0x12520
movq %r15, %rdi
movq %r13, %rsi
callq 0x202f0
xorl $0x7f, %ebp
cmpl %ebx, %ebp
jae 0x2148f
leal -0x3f(%rbp), %esi
addq %r14, %rsi
movq %r15, %rdi
callq 0x202f0
addl $0x40, %ebp
cmpl %ebx, %ebp
jb 0x21469
addl $-0x3f, %ebp
xorl %eax, %eax
movl %ebp, %r12d
jmp 0x21491
movl %ebp, %eax
xorl %r12d, %r12d
jmp 0x21491
xorl %eax, %eax
leaq (%r15,%rax), %rdi
addq $0x1c, %rdi
movl %r12d, %eax
addq %rax, %r14
subl %r12d, %ebx
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x12520
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/sha1.c
// Function: SHA1Final
void SHA1Final(unsigned char digest[20], SHA1_CTX* context)
{
    unsigned i;
    unsigned char finalcount[8];
    unsigned char c;

#if 0	/* untested "improvement" by DHR */
    /* Convert context->count to a sequence of bytes
     * in finalcount.  Second element first, but
     * big-endian order within element.
     * But we do it all backwards.
     */
    unsigned char *fcp = &finalcount[8];

    for (i = 0; i < 2; i++)
       {
        uint32_t t = context->count[i];
        int j;

        for (j = 0; j < 4; t >>= 8, j++)
	          *--fcp = (unsigned char) t;
    }
#else
    for (i = 0; i < 8; i++) {
        finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)]
         >> ((3-(i & 3)) * 8) ) & 255);  /* Endian independent */
    }
#endif
    c = 0200;
    SHA1Update(context, &c, 1);
    while ((context->count[0] & 504) != 448) {
	c = 0000;
        SHA1Update(context, &c, 1);
    }
    SHA1Update(context, finalcount, 8);  /* Should cause a SHA1Transform() */
    for (i = 0; i < 20; i++) {
        digest[i] = (unsigned char)
         ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255);
    }
    /* Wipe variables */
    memset(context, '\0', sizeof(*context));
    memset(&finalcount, '\0', sizeof(finalcount));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorl %eax, %eax
xorl %edx, %edx
xorl %ecx, %ecx
cmpq $0x4, %rdx
setb %cl
movl 0x14(%rbx,%rcx,4), %esi
movl %eax, %ecx
notb %cl
andb $0x18, %cl
shrl %cl, %esi
movb %sil, 0x10(%rsp,%rdx)
incq %rdx
addl $0x8, %eax
cmpq $0x8, %rdx
jne 0x214cf
leaq 0xf(%rsp), %rsi
movb $-0x80, (%rsi)
movq %rbx, %rdi
movl $0x1, %edx
callq 0x213f8
movl $0x1f8, %ebp            # imm = 0x1F8
movl 0x14(%rbx), %eax
andl %ebp, %eax
cmpl $0x1c0, %eax            # imm = 0x1C0
je 0x21542
leaq 0xf(%rsp), %r15
movb $0x0, 0xf(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x213f8
movl 0x14(%rbx), %eax
andl %ebp, %eax
cmpl $0x1c0, %eax            # imm = 0x1C0
jne 0x21521
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
movl $0x8, %edx
callq 0x213f8
xorl %eax, %eax
xorl %edx, %edx
movl %edx, %ecx
andl $-0x4, %ecx
movl (%rbx,%rcx), %esi
movl %eax, %ecx
notb %cl
andb $0x18, %cl
shrl %cl, %esi
movb %sil, (%r14,%rdx)
incq %rdx
addl $0x8, %eax
cmpq $0x14, %rdx
jne 0x21558
xorps %xmm0, %xmm0
movups %xmm0, 0x4c(%rbx)
movups %xmm0, 0x40(%rbx)
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: getStringObjectSdsUsedMemory
size_t getStringObjectSdsUsedMemory(robj *o) {
    serverAssertWithInfo(NULL,o,o->type == OBJ_STRING);
    switch(o->encoding) {
    case OBJ_ENCODING_RAW: return sdsZmallocSize(o->ptr);
    case OBJ_ENCODING_EMBSTR: return zmalloc_size(o)-sizeof(robj);
    default: return 0; /* Just integer encoding for now. */
    }
}

// Assembly:
pushq %rax
movq %rdi, %rsi
movl (%rdi), %eax
testb $0xf, %al
jne 0x21610
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x2, %eax
je 0x215fe
testl %eax, %eax
jne 0x2160c
movq 0x8(%rsi), %rdi
callq 0x1e3a8
movq %rax, %rdi
popq %rax
jmp 0x38ae1
movq %rsi, %rdi
callq 0x38ae1
addq $-0x10, %rax
jmp 0x2160e
xorl %eax, %eax
popq %rcx
retq
leaq 0x335e5(%rip), %rdx     # 0x54bfc
leaq 0x335f4(%rip), %rcx     # 0x54c12
xorl %edi, %edi
movl $0x30, %r8d
callq 0x2a9bc
movl $0x1, %edi
callq 0x12120
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: createClient
client *createClient(int fd) {
    client *c = zmalloc(sizeof(client));

    /* passing -1 as fd it is possible to create a non connected client.
     * This is useful since all the commands needs to be executed
     * in the context of a client. When commands are executed in other
     * contexts (for instance a Lua script) we need a non connected client. */
    if (fd != -1) {
        anetNonBlock(NULL,fd);
        anetEnableTcpNoDelay(NULL,fd);
        if (server.tcpkeepalive)
            anetKeepAlive(NULL,fd,server.tcpkeepalive);
        if (aeCreateFileEvent(server.el,fd,AE_READABLE,
            readQueryFromClient, c) == AE_ERR)
        {
            close(fd);
            zfree(c);
            return NULL;
        }
    }

    c->id = server.next_client_id++;
    c->fd = fd;
    c->name = NULL;
    c->bufpos = 0;
    c->querybuf = sdsempty();
    c->querybuf_peak = 0;
    c->reqtype = 0;
    c->argc = 0;
    c->argv = NULL;
    c->cmd = c->lastcmd = NULL;
    c->multibulklen = 0;
    c->bulklen = -1;
    c->sentlen = 0;
    c->flags = 0;
    c->ctime = c->lastinteraction = server.unixtime;
    c->authenticated = 0;
    c->reply = listCreate();
    c->reply_bytes = 0;
    c->obuf_soft_limit_reached_time = 0;
    listSetFreeMethod(c->reply,freeClientReplyValue);
    listSetDupMethod(c->reply,dupClientReplyValue);
    c->btype = BLOCKED_NONE;
    c->sub_counters = NULL;
    c->peerid = NULL;
    if (fd != -1) listAddNodeTail(server.clients,c);
    return c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebp
movl $0x40c0, %edi           # imm = 0x40C0
callq 0x1fea5
movq %rax, %rbx
cmpl $-0x1, %ebp
je 0x216af
xorl %edi, %edi
movl %ebp, %esi
callq 0x178ed
xorl %edi, %edi
movl %ebp, %esi
callq 0x17a1f
leaq 0x4da10(%rip), %r14     # 0x6f088
movl 0x5a0(%r14), %edx
testl %edx, %edx
je 0x2168c
xorl %edi, %edi
movl %ebp, %esi
callq 0x178fe
movq 0x38(%r14), %rdi
leaq 0xfa(%rip), %rcx        # 0x21791
movl %ebp, %esi
movl $0x1, %edx
movq %rbx, %r8
callq 0x17077
cmpl $-0x1, %eax
je 0x21772
leaq 0x4d9d2(%rip), %r14     # 0x6f088
movq 0x318(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x318(%r14)
movq %rax, (%rbx)
movl %ebp, 0x8(%rbx)
xorl %r15d, %r15d
movq %r15, 0x10(%rbx)
movl %r15d, 0xb8(%rbx)
callq 0x1de3f
movq %rax, 0x18(%rbx)
movq %r15, 0x20(%rbx)
movl %r15d, 0x28(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x40(%rbx)
movq $-0x1, 0x50(%rbx)
movq %r15, 0x68(%rbx)
movl %r15d, 0x88(%rbx)
movq 0x648(%r14), %rax
movq %rax, 0x78(%rbx)
movq %rax, 0x70(%rbx)
movl %r15d, 0x8c(%rbx)
callq 0x16a2c
movq %rax, 0x58(%rbx)
movq %r15, 0x60(%rbx)
movq %r15, 0x80(%rbx)
leaq -0x102(%rip), %rcx      # 0x2163a
movq %rcx, 0x18(%rax)
leaq -0x112(%rip), %rcx      # 0x21635
movq %rcx, 0x10(%rax)
movl %r15d, 0x90(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0xa8(%rbx)
cmpl $-0x1, %ebp
je 0x21783
movq 0x1e0(%r14), %rdi
movq %rbx, %rsi
callq 0x16aff
jmp 0x21783
movl %ebp, %edi
callq 0x123b0
movq %rbx, %rdi
callq 0x1ffff
xorl %ebx, %ebx
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/networking.c
// Function: prepareClientToWrite
int prepareClientToWrite(client *c) {
    /* CLIENT REPLY OFF / SKIP handling: don't send replies. */
    if (c->flags & (CLIENT_REPLY_OFF|CLIENT_REPLY_SKIP)) return C_ERR;

    if (c->fd <= 0) return C_ERR; /* Fake client */
    
    /* Schedule the client to write the output buffers to the socket only
     * if not already done (there were no pending writes already and the client
     * was yet not flagged), and, for slaves, if the slave can actually
     * receive writes at this stage. */
    if (!clientHasPendingReplies(c) &&
        !(c->flags & CLIENT_PENDING_WRITE))
    {
        /* Here instead of installing the write handler, we just flag the
         * client and put it into a list of clients that have something
         * to write to the socket. This way before re-entering the event
         * loop, we can try to directly write to the client sockets avoiding
         * a system call. We'll only really install the write handler if
         * we'll not be able to write the whole reply at once. */
        c->flags |= CLIENT_PENDING_WRITE;
        listAddNodeHead(server.clients_pending_write,c);
    }
    /* Authorize the caller to queue in the output buffer of this client. */
    return C_OK;
}

// Assembly:
pushq %rbx
movl 0x88(%rdi), %eax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl $0xa00000, %eax         # imm = 0xA00000
je 0x219d5
movl %ebx, %eax
popq %rbx
retq
movq %rdi, %rsi
cmpl $0x0, 0x8(%rdi)
jle 0x219d1
xorl %ebx, %ebx
cmpl $0x0, 0xb8(%rsi)
movl $0x0, %ecx
jne 0x219fa
movq 0x58(%rsi), %rcx
cmpq $0x0, 0x28(%rcx)
sete %cl
btl $0x14, %eax
jb 0x219d1
testb %cl, %cl
je 0x219d1
orl $0x100000, %eax         # imm = 0x100000
movl %eax, 0x88(%rsi)
leaq 0x4d672(%rip), %rax     # 0x6f088
movq 0x1f0(%rax), %rdi
callq 0x16aa0
jmp 0x219d1
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: addReplyToBuffer
int _addReplyToBuffer(client *c, const char *s, size_t len) {
    size_t available = sizeof(c->buf)-c->bufpos;

    if (c->flags & CLIENT_CLOSE_AFTER_REPLY) return C_OK;

    /* If there already are entries in the reply list, we cannot
     * add anything more to the static buffer. */
    if (listLength(c->reply) > 0) return C_ERR;

    /* Check that the buffer has enough space available for this string. */
    if (len > available) return C_ERR;

    memcpy(c->buf+c->bufpos,s,len);
    c->bufpos+=len;
    return C_OK;
}

// Assembly:
xorl %eax, %eax
testb $0x40, 0x88(%rdi)
jne 0x21aa4
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movslq 0xb8(%rdi), %rcx
movl $0x4000, %eax           # imm = 0x4000
subq %rcx, %rax
movq 0x58(%rdi), %rdx
cmpq $0x0, 0x28(%rdx)
setne %dl
cmpq %rbx, %rax
setb %al
orb %dl, %al
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x21a9d
leaq (%r14,%rcx), %rdi
addq $0xbc, %rdi
movq %rbx, %rdx
callq 0x12520
addl %ebx, 0xb8(%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: asyncCloseClientOnOutputBufferLimitReached
void asyncCloseClientOnOutputBufferLimitReached(client *c) {
    serverAssert(c->reply_bytes < SIZE_MAX-(1024*64));
    if (c->reply_bytes == 0 || c->flags & CLIENT_CLOSE_ASAP) return;
    if (checkClientOutputBufferLimits(c)) {
        sds client = catClientInfoString(sdsempty(),c);

        freeClientAsync(c);
        serverLog(LL_WARNING,"Client %s scheduled to be closed ASAP for overcoming of output buffer limits.", client);
        sdsfree(client);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x60(%rdi), %rax
cmpq $-0x10001, %rax         # imm = 0xFFFEFFFF
jae 0x21ce2
testq %rax, %rax
je 0x21cda
movq %rdi, %rbx
testb $0x4, 0x89(%rdi)
jne 0x21cda
movq %rbx, %rdi
callq 0x24d12
testl %eax, %eax
je 0x21cda
callq 0x1de3f
movq %rax, %rdi
movq %rbx, %rsi
callq 0x23e1d
movq %rax, %r14
movl 0x88(%rbx), %eax
btl $0xa, %eax
jb 0x21cb5
orl $0x400, %eax            # imm = 0x400
movl %eax, 0x88(%rbx)
leaq 0x4d3e2(%rip), %rax     # 0x6f088
movq 0x1e8(%rax), %rdi
movq %rbx, %rsi
callq 0x16aff
leaq 0x333d5(%rip), %rsi     # 0x55091
movl $0x3, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x19fb1
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1ded3
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x33384(%rip), %rdi     # 0x5506d
leaq 0x32f22(%rip), %rsi     # 0x54c12
movl $0x657, %edx            # imm = 0x657
callq 0x2a9ff
movl $0x1, %edi
callq 0x12120
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: addReplyStringToList
void _addReplyStringToList(client *c, const char *s, size_t len) {
    if (c->flags & CLIENT_CLOSE_AFTER_REPLY) return;

    if (listLength(c->reply) == 0) {
        sds node = sdsnewlen(s,len);
        listAddNodeTail(c->reply,node);
        c->reply_bytes += len;
    } else {
        listNode *ln = listLast(c->reply);
        sds tail = listNodeValue(ln);

        /* Append to this object when possible. If tail == NULL it was
         * set via addDeferredMultiBulkLength(). */
        if (tail && sdslen(tail)+len <= PROTO_REPLY_CHUNK_BYTES) {
            tail = sdscatlen(tail,s,len);
            listNodeValue(ln) = tail;
            c->reply_bytes += len;
        } else {
            sds node = sdsnewlen(s,len);
            listAddNodeTail(c->reply,node);
            c->reply_bytes += len;
        }
    }
    asyncCloseClientOnOutputBufferLimitReached(c);
}

// Assembly:
testb $0x40, 0x88(%rdi)
jne 0x21efd
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
movq 0x58(%rdi), %rax
cmpq $0x0, 0x28(%rax)
je 0x21f30
movq 0x8(%rax), %r15
movq 0x10(%r15), %rdi
testq %rdi, %rdi
je 0x21f30
movzbl -0x1(%rdi), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x21f15
leaq 0x32af5(%rip), %rdx     # 0x549e4
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
shrl $0x3, %eax
jmp 0x21f17
retq
movq -0x11(%rdi), %rax
jmp 0x21f17
movzwl -0x5(%rdi), %eax
jmp 0x21f17
movl -0x9(%rdi), %eax
jmp 0x21f17
movzbl -0x3(%rdi), %eax
jmp 0x21f17
xorl %eax, %eax
addq %rbx, %rax
cmpq $0x4000, %rax           # imm = 0x4000
ja 0x21f30
movq %rbx, %rdx
callq 0x1e66d
movq %rax, 0x10(%r15)
jmp 0x21f47
movq %rsi, %rdi
movq %rbx, %rsi
callq 0x1dd2c
movq 0x58(%r14), %rdi
movq %rax, %rsi
callq 0x16aff
addq %rbx, 0x60(%r14)
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x21c44
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: addReplySds
void addReplySds(client *c, sds s) {
    if (prepareClientToWrite(c) != C_OK) {
        /* The caller expects the sds to be free'd. */
        sdsfree(s);
        return;
    }
    if (_addReplyToBuffer(c,s,sdslen(s)) == C_OK) {
        sdsfree(s);
    } else {
        /* This method free's the sds when it is no longer needed. */
        _addReplySdsToList(c,s);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x219be
testl %eax, %eax
jne 0x2222b
movzbl -0x1(%rbx), %r15d
movl %r15d, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x221e2
leaq 0x32867(%rip), %rcx     # 0x54a20
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %r15d
jmp 0x221e5
movq -0x11(%rbx), %r15
jmp 0x221e5
movzwl -0x5(%rbx), %r15d
jmp 0x221e5
movl -0x9(%rbx), %r15d
jmp 0x221e5
movzbl -0x3(%rbx), %r15d
jmp 0x221e5
xorl %r15d, %r15d
testb $0x40, 0x88(%r14)
jne 0x2222b
movq 0x58(%r14), %rax
cmpq $0x0, 0x28(%rax)
jne 0x22238
movslq 0xb8(%r14), %rax
movl $0x4000, %ecx           # imm = 0x4000
subq %rax, %rcx
cmpq %r15, %rcx
jb 0x22238
leaq (%r14,%rax), %rdi
addq $0xbc, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x12520
addl %r15d, 0xb8(%r14)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1ded3
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x21d04
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: addReplyErrorFormat
void addReplyErrorFormat(client *c, const char *fmt, ...) {
    size_t l, j;
    va_list ap;
    va_start(ap,fmt);
    sds s = sdscatvprintf(sdsempty(),fmt,ap);
    va_end(ap);
    /* Make sure there are no newlines in the string, otherwise invalid protocol
     * is emitted. */
    l = sdslen(s);
    for (j = 0; j < l; j++) {
        if (s[j] == '\r' || s[j] == '\n') s[j] = ' ';
    }
    addReplyErrorLength(c,s,sdslen(s));
    sdsfree(s);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x22393
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %r15
movq %rsi, 0x10(%r15)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%r15)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%r15)
callq 0x1de3f
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1e9df
movq %rax, %r14
movzbl -0x1(%rax), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x22406
leaq 0x32656(%rip), %rdx     # 0x54a34
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
shrl $0x3, %eax
jmp 0x22408
movq -0x11(%r14), %rax
jmp 0x22408
movzwl -0x5(%r14), %eax
jmp 0x22408
movl -0x9(%r14), %eax
jmp 0x22408
movzbl -0x3(%r14), %eax
jmp 0x22408
xorl %eax, %eax
testq %rax, %rax
je 0x2242b
xorl %ecx, %ecx
movzbl (%r14,%rcx), %edx
cmpl $0xd, %edx
je 0x2241e
cmpl $0xa, %edx
jne 0x22423
movb $0x20, (%r14,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x2240f
movzbl -0x1(%r14), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x22469
leaq 0x32607(%rip), %rcx     # 0x54a48
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x2246b
movq -0x11(%r14), %rdx
jmp 0x2246b
movzwl -0x5(%r14), %edx
jmp 0x2246b
movl -0x9(%r14), %edx
jmp 0x2246b
movzbl -0x3(%r14), %edx
jmp 0x2246b
xorl %edx, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x222c4
movq %r14, %rdi
callq 0x1ded3
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: addReplyStatusFormat
void addReplyStatusFormat(client *c, const char *fmt, ...) {
    va_list ap;
    va_start(ap,fmt);
    sds s = sdscatvprintf(sdsempty(),fmt,ap);
    va_end(ap);
    addReplyStatusLength(c,s,sdslen(s));
    sdsfree(s);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x2255a
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %r15
movq %rsi, 0x10(%r15)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%r15)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%r15)
callq 0x1de3f
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1e9df
movq %rax, %r14
movzbl -0x1(%rax), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x225cd
leaq 0x324b7(%rip), %rcx     # 0x54a5c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x225cf
movq -0x11(%r14), %rdx
jmp 0x225cf
movzwl -0x5(%r14), %edx
jmp 0x225cf
movl -0x9(%r14), %edx
jmp 0x225cf
movzbl -0x3(%r14), %edx
jmp 0x225cf
xorl %edx, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2248b
movq %r14, %rdi
callq 0x1ded3
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: addDeferredMultiBulkLength
void *addDeferredMultiBulkLength(client *c) {
    /* Note that we install the write event here even if the object is not
     * ready to be sent, since we are sure that before returning to the
     * event loop setDeferredMultiBulkLength() will be called. */
    if (prepareClientToWrite(c) != C_OK) return NULL;
    listAddNodeTail(c->reply,NULL); /* NULL is our placeholder. */
    return listLast(c->reply);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x219be
testl %eax, %eax
je 0x22600
xorl %eax, %eax
jmp 0x22613
movq 0x58(%rbx), %rdi
xorl %esi, %esi
callq 0x16aff
movq 0x58(%rbx), %rax
movq 0x8(%rax), %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: setDeferredMultiBulkLength
void setDeferredMultiBulkLength(client *c, void *node, long length) {
    listNode *ln = (listNode*)node;
    sds len, next;

    /* Abort when *node is NULL: when the client should not accept writes
     * we return NULL in addDeferredMultiBulkLength() */
    if (node == NULL) return;

    len = sdscatprintf(sdsnewlen("*",1),"%ld\r\n",length);
    listNodeValue(ln) = len;
    c->reply_bytes += sdslen(len);
    if (ln->next != NULL) {
        next = listNodeValue(ln->next);

        /* Only glue when the next node is non-NULL (an sds in this case) */
        if (next != NULL) {
            len = sdscatsds(len,next);
            listDelNode(c->reply,ln->next);
            listNodeValue(ln) = len;
            /* No need to update c->reply_bytes: we are just moving the same
             * amount of bytes from one node to another. */
        }
    }
    asyncCloseClientOnOutputBufferLimitReached(c);
}

// Assembly:
testq %rsi, %rsi
je 0x2267d
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x308ab(%rip), %rdi     # 0x52edd
movl $0x1, %esi
callq 0x1dd2c
leaq 0x32606(%rip), %rsi     # 0x54c49
xorl %r12d, %r12d
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x1eace
movq %rax, 0x10(%r14)
movzbl -0x1(%rax), %ecx
movl %ecx, %edx
andl $0x7, %edx
cmpl $0x4, %edx
ja 0x22696
leaq 0x32404(%rip), %rsi     # 0x54a70
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
shrl $0x3, %ecx
movq %rcx, %r12
jmp 0x22696
retq
movq -0x11(%rax), %r12
jmp 0x22696
movzwl -0x5(%rax), %r12d
jmp 0x22696
movl -0x9(%rax), %r12d
jmp 0x22696
movzbl -0x3(%rax), %r12d
addq %r12, 0x60(%rbx)
movq 0x8(%r14), %rcx
testq %rcx, %rcx
je 0x226c8
movq 0x10(%rcx), %rsi
testq %rsi, %rsi
je 0x226c8
movq %rax, %rdi
callq 0x1e764
movq %rax, %r15
movq 0x58(%rbx), %rdi
movq 0x8(%r14), %rsi
callq 0x16be4
movq %r15, 0x10(%r14)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x21c44
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: addReplyDouble
void addReplyDouble(client *c, double d) {
    char dbuf[128], sbuf[128];
    int dlen, slen;
    if (isinf(d)) {
        /* Libc in odd systems (Hi Solaris!) will format infinite in a
         * different way, so better to handle it in an explicit way. */
        addReplyBulkCString(c, d > 0 ? "inf" : "-inf");
    } else {
        dlen = snprintf(dbuf,sizeof(dbuf),"%.17g",d);
        slen = snprintf(sbuf,sizeof(sbuf),"$%d\r\n%s\r\n",dlen,dbuf);
        addReplyString(c,sbuf,slen);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rdi, %rbx
movq %xmm0, %rax
btrq $0x3f, %rax
movabsq $0x7ff0000000000000, %rcx # imm = 0x7FF0000000000000
cmpq %rcx, %rax
jne 0x2273a
xorpd %xmm1, %xmm1
xorl %edx, %edx
ucomisd %xmm1, %xmm0
leaq 0x3253c(%rip), %rax     # 0x54c50
leaq 0x32534(%rip), %rsi     # 0x54c4f
cmovaq %rax, %rsi
setbe %dl
addq $0x3, %rdx
movq %rbx, %rdi
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %r15
jmp 0x22a7d
leaq 0x32513(%rip), %rdx     # 0x54c54
leaq 0x80(%rsp), %r14
movl $0x80, %esi
movq %r14, %rdi
movb $0x1, %al
callq 0x122d0
leaq 0x324fb(%rip), %rdx     # 0x54c5a
movq %rsp, %r15
movl $0x80, %esi
movq %r15, %rdi
movl %eax, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0x122d0
movslq %eax, %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x22248
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: addReplyBulkCString
void addReplyBulkCString(client *c, const char *s) {
    if (s == NULL) {
        addReply(c,shared.nullbulk);
    } else {
        addReplyBulkCBuffer(c,s,strlen(s));
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rsi, %rsi
je 0x227bd
movq %rsi, %r14
movq %rsi, %rdi
callq 0x12250
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x22a7d
leaq 0x4cfd4(%rip), %rax     # 0x6f798
movq 0x50(%rax), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x21f58
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: addReplyLongDouble
void addReplyLongDouble(client *c, long double ld) {
    char dbuf[128], sbuf[128];
    int dlen, slen;
    if (isinf(ld)) {
        /* Libc in odd systems (Hi Solaris!) will format infinite in a
         * different way, so better to handle it in an explicit way. */
        addReplyBulkCString(c, ld > 0 ? "inf" : "-inf");
    } else {
        dlen = snprintf(dbuf,sizeof(dbuf),"%.17Lg",ld);
        slen = snprintf(sbuf,sizeof(sbuf),"$%d\r\n%s\r\n",dlen,dbuf);
        addReplyString(c,sbuf,slen);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x120, %rsp            # imm = 0x120
movq %rdi, %rbx
fldt 0x140(%rsp)
fld %st(0)
fstpt 0x10(%rsp)
movl 0x18(%rsp), %eax
notl %eax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq 0x10(%rsp), %rcx
andl $0x7fff, %eax           # imm = 0x7FFF
orq %rcx, %rax
jne 0x22849
fldz
xorl %edx, %edx
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
leaq 0x3242d(%rip), %rax     # 0x54c50
leaq 0x32425(%rip), %rsi     # 0x54c4f
cmovaq %rax, %rsi
setbe %dl
addq $0x3, %rdx
movq %rbx, %rdi
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r14
popq %r15
jmp 0x22a7d
fstpt (%rsp)
leaq 0x32411(%rip), %rdx     # 0x54c64
leaq 0xa0(%rsp), %r14
movl $0x80, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x122d0
leaq 0x323e9(%rip), %rdx     # 0x54c5a
leaq 0x20(%rsp), %r15
movl $0x80, %esi
movq %r15, %rdi
movl %eax, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0x122d0
movslq %eax, %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x22248
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: addReplyLongLongWithPrefix
void addReplyLongLongWithPrefix(client *c, long long ll, char prefix) {
    char buf[128];
    int len;

    /* Things like $3\r\n or *2\r\n are emitted very often by the protocol
     * so we have a few shared objects to use if the integer is small
     * like it is most of the times. */
    if (prefix == '*' && ll < OBJ_SHARED_BULKHDR_LEN && ll >= 0) {
        addReply(c,shared.mbulkhdr[ll]);
        return;
    } else if (prefix == '$' && ll < OBJ_SHARED_BULKHDR_LEN && ll >= 0) {
        addReply(c,shared.bulkhdr[ll]);
        return;
    }

    buf[0] = prefix;
    len = ll2string(buf+1,sizeof(buf)-1,ll);
    buf[len+1] = '\r';
    buf[len+2] = '\n';
    addReplyString(c,buf,len+3);
}

// Assembly:
pushq %rbx
subq $0x80, %rsp
movq %rsi, %rax
movq %rdi, %rbx
cmpb $0x2a, %dl
setne %cl
cmpq $0x20, %rsi
setae %sil
orb %cl, %sil
jne 0x228d7
leaq 0x4cecb(%rip), %rcx     # 0x6f798
movq 0x139c8(%rcx,%rax,8), %rsi
jmp 0x228f9
cmpq $0x20, %rax
setae %cl
cmpb $0x24, %dl
setne %sil
orb %cl, %sil
jne 0x22909
leaq 0x4cea7(%rip), %rcx     # 0x6f798
movq 0x13ac8(%rcx,%rax,8), %rsi
movq %rbx, %rdi
addq $0x80, %rsp
popq %rbx
jmp 0x21f58
leaq 0x1(%rsp), %rdi
movb %dl, -0x1(%rdi)
movl $0x7f, %esi
movq %rax, %rdx
callq 0x2535e
cltq
movq %rsp, %rsi
movw $0xa0d, 0x1(%rax,%rsi)  # imm = 0xA0D
addl $0x3, %eax
movslq %eax, %rdx
movq %rbx, %rdi
callq 0x22248
addq $0x80, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: addReplyLongLong
void addReplyLongLong(client *c, long long ll) {
    if (ll == 0)
        addReply(c,shared.czero);
    else if (ll == 1)
        addReply(c,shared.cone);
    else
        addReplyLongLongWithPrefix(c,ll,':');
}

// Assembly:
cmpq $0x1, %rsi
je 0x2295c
testq %rsi, %rsi
jne 0x2296c
leaq 0x4ce45(%rip), %rax     # 0x6f798
movq 0x20(%rax), %rsi
jmp 0x21f58
leaq 0x4ce35(%rip), %rax     # 0x6f798
movq 0x28(%rax), %rsi
jmp 0x21f58
movl $0x3a, %edx
jmp 0x228a5
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: addReplyBulkLen
void addReplyBulkLen(client *c, robj *obj) {
    size_t len;

    if (sdsEncodedObject(obj)) {
        len = sdslen(obj->ptr);
    } else {
        long n = (long)obj->ptr;

        /* Compute how many bytes will take this integer as a radix 10 string */
        len = 1;
        if (n < 0) {
            len++;
            n = -n;
        }
        while((n = n/10) != 0) {
            len++;
        }
    }

    if (len < OBJ_SHARED_BULKHDR_LEN)
        addReply(c,shared.bulkhdr[len]);
    else
        addReplyLongLongWithPrefix(c,len,'$');
}

// Assembly:
movl (%rsi), %eax
shrl $0x4, %eax
testb $0xd, %al
jne 0x229ca
movq 0x8(%rsi), %rax
movzbl -0x1(%rax), %esi
movl %esi, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x22a24
leaq 0x320c8(%rip), %rdx     # 0x54a84
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
shrl $0x3, %esi
jmp 0x22a26
movq 0x8(%rsi), %rax
movq %rax, %rcx
negq %rcx
movq %rax, %rsi
shrq $0x3f, %rsi
incq %rsi
testq %rax, %rax
cmovnsq %rax, %rcx
cmpq $0xa, %rcx
jb 0x22a26
movabsq $-0x3333333333333333, %r8 # imm = 0xCCCCCCCCCCCCCCCD
movq %rcx, %rax
mulq %r8
shrq $0x3, %rdx
incq %rsi
cmpq $0x63, %rcx
movq %rdx, %rcx
ja 0x229f5
jmp 0x22a26
movq -0x11(%rax), %rsi
jmp 0x22a26
movzwl -0x5(%rax), %esi
jmp 0x22a26
movl -0x9(%rax), %esi
jmp 0x22a26
movzbl -0x3(%rax), %esi
jmp 0x22a26
xorl %esi, %esi
cmpq $0x1f, %rsi
ja 0x22a40
leaq 0x4cd65(%rip), %rax     # 0x6f798
movq 0x13ac8(%rax,%rsi,8), %rsi
jmp 0x21f58
movl $0x24, %edx
jmp 0x228a5
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: addReplyBulkSds
void addReplyBulkSds(client *c, sds s)  {
    addReplySds(c,sdscatfmt(sdsempty(),"$%u\r\n",
        (unsigned long)sdslen(s)));
    addReplySds(c,s);
    addReply(c,shared.crlf);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x1de3f
movzbl -0x1(%r14), %edx
movl %edx, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x22b0a
leaq 0x31fb6(%rip), %rsi     # 0x54a98
movslq (%rsi,%rcx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
shrl $0x3, %edx
jmp 0x22b0c
movq -0x11(%r14), %rdx
jmp 0x22b0c
movzwl -0x5(%r14), %edx
jmp 0x22b0c
movl -0x9(%r14), %edx
jmp 0x22b0c
movzbl -0x3(%r14), %edx
jmp 0x22b0c
xorl %edx, %edx
leaq 0x32158(%rip), %rsi     # 0x54c6b
movq %rax, %rdi
xorl %eax, %eax
callq 0x1eb52
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2218a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2218a
leaq 0x4cc5e(%rip), %rax     # 0x6f798
movq (%rax), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x21f58
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: copyClientOutputBuffer
void copyClientOutputBuffer(client *dst, client *src) {
    listRelease(dst->reply);
    dst->reply = listDup(src->reply);
    memcpy(dst->buf,src->buf,src->bufpos);
    dst->bufpos = src->bufpos;
    dst->reply_bytes = src->reply_bytes;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x58(%rdi), %rdi
callq 0x16a50
movq 0x58(%rbx), %rdi
callq 0x16ca8
movq %rax, 0x58(%r14)
movl $0xbc, %esi
leaq (%r14,%rsi), %rdi
addq %rbx, %rsi
movslq 0xb8(%rbx), %rdx
callq 0x12520
movl 0xb8(%rbx), %eax
movl %eax, 0xb8(%r14)
movq 0x60(%rbx), %rax
movq %rax, 0x60(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: acceptTcpHandler
void acceptTcpHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
    int cport, cfd, max = MAX_ACCEPTS_PER_CALL;
    char cip[NET_IP_STR_LEN];
    UNUSED(el);
    UNUSED(mask);
    UNUSED(privdata);

    while(max--) {
        cfd = anetTcpAccept(server.neterr, fd, cip, sizeof(cip), &cport);
        if (cfd == ANET_ERR) {
            if (errno != EWOULDBLOCK)
                serverLog(LL_WARNING,
                    "Accepting client connection: %s", server.neterr);
            return;
        }
        serverLog(LL_VERBOSE,"Accepted %s:%d", cip, cport);
        acceptCommonHandler(cfd,0);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, %ebx
movl $0x218, %r14d           # imm = 0x218
addq 0x4b3c7(%rip), %r14     # 0x6dfb8
movl $0xfffffc18, %r13d      # imm = 0xFFFFFC18
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
movl $0x2e, %ecx
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
movq %r12, %r8
callq 0x18386
cmpl $-0x1, %eax
je 0x22c47
movl %eax, %ebp
movl 0xc(%rsp), %ecx
movl $0x1, %edi
leaq 0x32064(%rip), %rsi     # 0x54c91
movq %r15, %rdx
xorl %eax, %eax
callq 0x19fb1
movl %ebp, %edi
xorl %esi, %esi
callq 0x22c7f
incl %r13d
jne 0x22c01
jmp 0x22c70
callq 0x120d0
cmpl $0xb, (%rax)
je 0x22c70
movl $0x218, %edx            # imm = 0x218
addq 0x4b35b(%rip), %rdx     # 0x6dfb8
leaq 0x3200d(%rip), %rsi     # 0x54c71
movl $0x3, %edi
xorl %eax, %eax
callq 0x19fb1
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: acceptCommonHandler
static void acceptCommonHandler(int fd, int flags) {
    client *c;
    if ((c = createClient(fd)) == NULL) {
        serverLog(LL_WARNING,
            "Error registering fd event for the new client: %s (fd=%d)",
            strerror(errno),fd);
        close(fd); /* May be already closed, just ignore errors */
        return;
    }
    /* If maxclient directive is set and this is one client more... close the
     * connection. Note that we create the client instead to check before
     * for this condition, since now the socket is already set in non-blocking
     * mode and we can send an error for free using the Kernel I/O */
    if (listLength(server.clients) > server.maxclients) {
        char *err = "-ERR max number of clients reached\r\n";

        /* That's a best effort error message, don't check write errors */
        if (write(c->fd,err,strlen(err)) == -1) {
            /* Nothing to do, Just to avoid the warning... */
        }
        server.stat_rejected_conn++;
        freeClient(c);
        return;
    }
    server.stat_numconnections++;
    c->flags |= flags;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movl %edi, %ebx
callq 0x21644
testq %rax, %rax
je 0x22cd6
movq %rax, %r14
leaq 0x4c3ed(%rip), %rbx     # 0x6f088
movq 0x1e0(%rbx), %rax
movl 0x60c(%rbx), %ecx
cmpq %rcx, 0x28(%rax)
jbe 0x22d05
movl 0x8(%r14), %edi
leaq 0x32460(%rip), %rsi     # 0x55119
movl $0x24, %edx
callq 0x121e0
incq 0x3a0(%rbx)
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x22f00
callq 0x120d0
movl (%rax), %edi
callq 0x128f0
leaq 0x323f6(%rip), %rsi     # 0x550df
movl $0x3, %edi
movq %rax, %rdx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x19fb1
movl %ebx, %edi
popq %rbx
popq %r14
popq %rbp
jmp 0x123b0
incq 0x380(%rbx)
orl %ebp, 0x88(%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: acceptUnixHandler
void acceptUnixHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
    int cfd, max = MAX_ACCEPTS_PER_CALL;
    UNUSED(el);
    UNUSED(mask);
    UNUSED(privdata);

    while(max--) {
        cfd = anetUnixAccept(server.neterr, fd);
        if (cfd == ANET_ERR) {
            if (errno != EWOULDBLOCK)
                serverLog(LL_WARNING,
                    "Accepting client connection: %s", server.neterr);
            return;
        }
        serverLog(LL_VERBOSE,"Accepted connection to %s", server.unixsocket);
        acceptCommonHandler(cfd,CLIENT_UNIX_SOCKET);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movl $0xfffffc18, %r12d      # imm = 0xFFFFFC18
movl $0x218, %r14d           # imm = 0x218
addq 0x4b280(%rip), %r14     # 0x6dfb8
leaq 0x4c349(%rip), %r13     # 0x6f088
leaq 0x31f5a(%rip), %r15     # 0x54ca0
movq %r14, %rdi
movl %ebx, %esi
callq 0x1846e
cmpl $-0x1, %eax
je 0x22d80
movl %eax, %ebp
movq 0x148(%r13), %rdx
movl $0x1, %edi
movq %r15, %rsi
xorl %eax, %eax
callq 0x19fb1
movl %ebp, %edi
movl $0x800, %esi            # imm = 0x800
callq 0x22c7f
incl %r12d
jne 0x22d46
jmp 0x22d8a
callq 0x120d0
cmpl $0xb, (%rax)
jne 0x22d99
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x218, %edx            # imm = 0x218
addq 0x4b213(%rip), %rdx     # 0x6dfb8
leaq 0x31ec5(%rip), %rsi     # 0x54c71
movl $0x3, %edi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x19fb1
// File: /workspace/github_c_makefile_star2_O1/erikdubbelboer[P]discnt/src/networking.c
// Function: unlinkClient
void unlinkClient(client *c) {
    listNode *ln;

    /* If this is marked as current client unset it. */
    if (server.current_client == c) server.current_client = NULL;

    /* Certain operations must be done only if the client has an active socket.
     * If the client was already unlinked or if it's a "fake client" the
     * fd is already set to -1. */
    if (c->fd != -1) {
        /* Remove from the list of active clients. */
        ln = listSearchKey(server.clients,c);
        serverAssert(ln != NULL);
        listDelNode(server.clients,ln);

        /* Unregister async I/O handlers and close the socket. */
        aeDeleteFileEvent(server.el,c->fd,AE_READABLE);
        aeDeleteFileEvent(server.el,c->fd,AE_WRITABLE);
        close(c->fd);
        c->fd = -1;
    }

    /* Remove from the list of pending writes if needed. */
    if (c->flags & CLIENT_PENDING_WRITE) {
        ln = listSearchKey(server.clients_pending_write,c);
        serverAssert(ln != NULL);
        listDelNode(server.clients_pending_write,ln);
        c->flags &= ~CLIENT_PENDING_WRITE;
    }

    /* When client was just unblocked because of a blocking operation,
     * remove it from the list of unblocked clients. */
    if (c->flags & CLIENT_UNBLOCKED) {
        ln = listSearchKey(server.unblocked_clients,c);
        serverAssert(ln != NULL);
        listDelNode(server.unblocked_clients,ln);
        c->flags &= ~CLIENT_UNBLOCKED;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4c2b4(%rip), %r14     # 0x6f088
cmpq %rdi, 0x200(%r14)
jne 0x22de8
movq $0x0, 0x200(%r14)
cmpl $-0x1, 0x8(%rbx)
je 0x22e46
movq 0x1e0(%r14), %rdi
movq %rbx, %rsi
callq 0x16d75
testq %rax, %rax
je 0x22eb4
movq 0x1e0(%r14), %rdi
movq %rax, %rsi
callq 0x16be4
movq 0x38(%r14), %rdi
movl 0x8(%rbx), %esi
movl $0x1, %edx
callq 0x1713d
movq 0x38(%r14), %rdi
movl 0x8(%rbx), %esi
movl $0x2, %edx
callq 0x1713d
movl 0x8(%rbx), %edi
callq 0x123b0
movl $0xffffffff, 0x8(%rbx)  # imm = 0xFFFFFFFF
testb $0x10, 0x8a(%rbx)
je 0x22e79
movq 0x1f0(%r14), %rdi
movq %rbx, %rsi
callq 0x16d75
testq %rax, %rax
je 0x22ec9
movq 0x1f0(%r14), %rdi
movq %rax, %rsi
callq 0x16be4
andb $-0x11, 0x8a(%rbx)
testb $-0x80, 0x88(%rbx)
je 0x22eac
movq 0x638(%r14), %rdi
movq %rbx, %rsi
callq 0x16d75
testq %rax, %rax
je 0x22ede
movq 0x638(%r14), %rdi
movq %rax, %rsi
callq 0x16be4
andb $0x7f, 0x88(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x31dff(%rip), %rdi     # 0x54cba
leaq 0x31d50(%rip), %rsi     # 0x54c12
movl $0x291, %edx            # imm = 0x291
jmp 0x22ef1
leaq 0x31dea(%rip), %rdi     # 0x54cba
leaq 0x31d3b(%rip), %rsi     # 0x54c12
movl $0x29e, %edx            # imm = 0x29E
jmp 0x22ef1
leaq 0x31dd5(%rip), %rdi     # 0x54cba
leaq 0x31d26(%rip), %rsi     # 0x54c12
movl $0x2a7, %edx            # imm = 0x2A7
callq 0x2a9ff
movl $0x1, %edi
callq 0x12120