LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/anet.c
// Function: anetCreateSocket
static int anetCreateSocket(char *err, int domain) {
    int s;
    if ((s = socket(domain, SOCK_STREAM, 0)) == -1) {
        anetSetError(err, "creating socket: %s", strerror(errno));
        return ANET_ERR;
    }

    /* Make sure connection-intensive things like the redis benchmark
     * will be able to close/open sockets a zillion of times */
    if (anetSetReuseAddr(err,s) == ANET_ERR) {
        close(s);
        return ANET_ERR;
    }
    return s;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x10740
cmpl $-0x1, %eax
je 0x150ea
movl %eax, %ebp
movq %rbx, %rdi
movl %eax, %esi
callq 0x15842
cmpl $-0x1, %eax
jne 0x1510f
movl %ebp, %edi
callq 0x102a0
jmp 0x1510a
callq 0x100a0
movl (%rax), %edi
callq 0x10690
leaq 0x2b029(%rip), %rsi     # 0x40126
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x14915
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/anet.c
// Function: anetRead
int anetRead(int fd, char *buf, int count)
{
    ssize_t nread, totlen = 0;
    while(totlen != count) {
        nread = read(fd,buf,count-totlen);
        if (nread == 0) return totlen;
        if (nread == -1) return -1;
        totlen += nread;
        buf += nread;
    }
    return totlen;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testl %edx, %edx
je 0x1516a
movl %edx, %ebx
movq %rsi, %r14
movl %edi, %ebp
movslq %edx, %r12
xorl %r15d, %r15d
movq %r12, %rdx
subq %r15, %rdx
movl %ebp, %edi
movq %r14, %rsi
callq 0x102f0
cmpq $-0x1, %rax
je 0x15173
testq %rax, %rax
je 0x1516e
addq %rax, %r15
addq %rax, %r14
cmpq %r12, %r15
jne 0x15142
jmp 0x15178
xorl %ebx, %ebx
jmp 0x15178
movl %r15d, %ebx
jmp 0x15178
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/anet.c
// Function: anetWrite
int anetWrite(int fd, char *buf, int count)
{
    ssize_t nwritten, totlen = 0;
    while(totlen != count) {
        nwritten = write(fd,buf,count-totlen);
        if (nwritten == 0) return totlen;
        if (nwritten == -1) return -1;
        totlen += nwritten;
        buf += nwritten;
    }
    return totlen;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testl %edx, %edx
je 0x151c4
movl %edx, %ebx
movq %rsi, %r14
movl %edi, %ebp
movslq %edx, %r12
xorl %r15d, %r15d
movq %r12, %rdx
subq %r15, %rdx
movl %ebp, %edi
movq %r14, %rsi
callq 0x10170
cmpq $-0x1, %rax
je 0x151cd
testq %rax, %rax
je 0x151c8
addq %rax, %r15
addq %rax, %r14
cmpq %r12, %r15
jne 0x1519c
jmp 0x151d2
xorl %ebx, %ebx
jmp 0x151d2
movl %r15d, %ebx
jmp 0x151d2
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/anet.c
// Function: anetTcpServer
static int _anetTcpServer(char *err, int port, char *bindaddr, int af, int backlog)
{
    int s = -1, rv;
    char _port[6];  /* strlen("65535") */
    struct addrinfo hints, *servinfo, *p;

    snprintf(_port,6,"%d",port);
    memset(&hints,0,sizeof(hints));
    hints.ai_family = af;
    hints.ai_socktype = SOCK_STREAM;
    hints.ai_flags = AI_PASSIVE;    /* No effect if bindaddr != NULL */

    if ((rv = getaddrinfo(bindaddr,_port,&hints,&servinfo)) != 0) {
        anetSetError(err, "%s", gai_strerror(rv));
        return ANET_ERR;
    }
    for (p = servinfo; p != NULL; p = p->ai_next) {
        if ((s = socket(p->ai_family,p->ai_socktype,p->ai_protocol)) == -1)
            continue;

        if (af == AF_INET6 && anetV6Only(err,s) == ANET_ERR) goto error;
        if (anetSetReuseAddr(err,s) == ANET_ERR) goto error;
        if (anetListen(err,s,p->ai_addr,p->ai_addrlen,backlog) == ANET_ERR) goto error;
        goto end;
    }
    if (p == NULL) {
        anetSetError(err, "unable to bind socket, errno: %d", errno);
        goto error;
    }

error:
    if (s != -1) close(s);
    s = ANET_ERR;
end:
    freeaddrinfo(servinfo);
    return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movl %r8d, %ebp
movl %ecx, %r15d
movq %rdx, %r14
movl %esi, %ecx
movq %rdi, %rbx
leaq 0x2af6c(%rip), %rdx     # 0x40174
leaq 0x1a(%rsp), %r12
movl $0x6, %esi
movq %r12, %rdi
xorl %eax, %eax
callq 0x10200
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdx
movups %xmm0, 0x8(%rdx)
movups %xmm0, 0x18(%rdx)
movq $0x0, 0x28(%rdx)
movl %r15d, 0x4(%rdx)
movl $0x1, %eax
movl %eax, 0x8(%rdx)
movl %eax, (%rdx)
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
movq %r12, %rsi
callq 0x10670
testl %eax, %eax
je 0x1527c
movl %eax, %edi
callq 0x10220
leaq 0x2adce(%rip), %rsi     # 0x40032
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x14915
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x15363
movq 0x8(%rsp), %r12
testq %r12, %r12
je 0x152a6
movl 0x4(%r12), %edi
movl 0x8(%r12), %esi
movl 0xc(%r12), %edx
callq 0x10740
cmpl $-0x1, %eax
jne 0x152c3
movq 0x28(%r12), %r12
jmp 0x15281
callq 0x100a0
movl (%rax), %edx
leaq 0x2aea2(%rip), %rsi     # 0x40156
movq %rbx, %rdi
xorl %eax, %eax
callq 0x14915
jmp 0x15353
movl %eax, %r14d
cmpl $0xa, %r15d
jne 0x152f4
leaq 0x14(%rsp), %rcx
movl $0x1, (%rcx)
movl %r14d, %edi
movl $0x29, %esi
movl $0x1a, %edx
movl $0x4, %r8d
callq 0x10120
cmpl $-0x1, %eax
je 0x15323
movq %rbx, %rdi
movl %r14d, %esi
callq 0x15842
cmpl $-0x1, %eax
je 0x1534b
movq 0x18(%r12), %rdx
movl 0x10(%r12), %ecx
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %r8d
callq 0x15413
cmpl $-0x1, %eax
jne 0x15359
jmp 0x1534b
callq 0x100a0
movl (%rax), %edi
callq 0x10690
leaq 0x2ae41(%rip), %rsi     # 0x40177
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x14915
movl %r14d, %edi
callq 0x102a0
movl %r14d, %edi
callq 0x102a0
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movq 0x8(%rsp), %rdi
callq 0x10730
movl %r14d, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/anet.c
// Function: anetUnixServer
int anetUnixServer(char *err, char *path, mode_t perm, int backlog)
{
    int s;
    struct sockaddr_un sa;

    if ((s = anetCreateSocket(err,AF_LOCAL)) == ANET_ERR)
        return ANET_ERR;

    memset(&sa,0,sizeof(sa));
    sa.sun_family = AF_LOCAL;
    strncpy(sa.sun_path,path,sizeof(sa.sun_path)-1);
    if (anetListen(err,s,(struct sockaddr*)&sa,sizeof(sa),backlog) == ANET_ERR)
        return ANET_ERR;
    if (perm)
        chmod(sa.sun_path, perm);
    return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %ecx, %r15d
movl %edx, 0x4(%rsp)
movq %rsi, %rbx
movq %rdi, %r13
callq 0x150b4
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpl $-0x1, %eax
je 0x15401
movl %eax, %ebp
leaq 0xc(%rsp), %r12
movw $0x0, 0x6a(%r12)
movw $0x1, -0x2(%r12)
movl $0x6b, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x100b0
leaq 0xa(%rsp), %rdx
movq %r13, %rdi
movl %ebp, %esi
movl $0x6e, %ecx
movl %r15d, %r8d
callq 0x15413
cmpl $-0x1, %eax
je 0x15401
movl 0x4(%rsp), %esi
testl %esi, %esi
je 0x153fe
movq %r12, %rdi
callq 0x104f0
movl %ebp, %r14d
movl %r14d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/anet.c
// Function: anetTcpAccept
int anetTcpAccept(char *err, int s, char *ip, size_t ip_len, int *port) {
    int fd;
    struct sockaddr_storage sa;
    socklen_t salen = sizeof(sa);
    if ((fd = anetGenericAccept(err,s,(struct sockaddr*)&sa,&salen)) == -1)
        return ANET_ERR;

    if (sa.ss_family == AF_INET) {
        struct sockaddr_in *s = (struct sockaddr_in *)&sa;
        if (ip) inet_ntop(AF_INET,(void*)&(s->sin_addr),ip,ip_len);
        if (port) *port = ntohs(s->sin_port);
    } else {
        struct sockaddr_in6 *s = (struct sockaddr_in6 *)&sa;
        if (ip) inet_ntop(AF_INET6,(void*)&(s->sin6_addr),ip,ip_len);
        if (port) *port = ntohs(s->sin6_port);
    }
    return fd;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
leaq 0x4(%rsp), %rcx
movl $0x80, (%rcx)
leaq 0x8(%rsp), %rdx
callq 0x15510
movl %eax, %ebp
cmpl $-0x1, %eax
je 0x15500
cmpw $0x2, 0x8(%rsp)
jne 0x154d3
testq %r15, %r15
je 0x154ed
leaq 0xc(%rsp), %rsi
movl $0x2, %edi
jmp 0x154e2
testq %r15, %r15
je 0x154ed
leaq 0x10(%rsp), %rsi
movl $0xa, %edi
movq %r15, %rdx
movl %r14d, %ecx
callq 0x10040
testq %rbx, %rbx
je 0x15500
movzwl 0xa(%rsp), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl %eax, (%rbx)
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/anet.c
// Function: anetGenericAccept
static int anetGenericAccept(char *err, int s, struct sockaddr *sa, socklen_t *len) {
    int fd;
    while(1) {
        fd = accept(s,sa,len);
        if (fd == -1) {
            if (errno == EINTR)
                continue;
            else {
                anetSetError(err, "accept: %s", strerror(errno));
                return ANET_ERR;
            }
        }
        break;
    }
    return fd;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r15
movq %rdx, %r12
movl %esi, %ebp
movq %rdi, %r14
movl %ebp, %edi
movq %r12, %rsi
movq %r15, %rdx
callq 0x105d0
movl %eax, %ebx
cmpl $-0x1, %eax
jne 0x1555c
callq 0x100a0
movl (%rax), %edi
cmpl $0x4, %edi
je 0x15523
callq 0x10690
leaq 0x2ac42(%rip), %rsi     # 0x40191
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x14915
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/anet.c
// Function: anetPeerToString
int anetPeerToString(int fd, char *ip, size_t ip_len, int *port) {
    struct sockaddr_storage sa;
    socklen_t salen = sizeof(sa);

    if (getpeername(fd,(struct sockaddr*)&sa,&salen) == -1) goto error;
    if (ip_len == 0) goto error;

    if (sa.ss_family == AF_INET) {
        struct sockaddr_in *s = (struct sockaddr_in *)&sa;
        if (ip) inet_ntop(AF_INET,(void*)&(s->sin_addr),ip,ip_len);
        if (port) *port = ntohs(s->sin_port);
    } else if (sa.ss_family == AF_INET6) {
        struct sockaddr_in6 *s = (struct sockaddr_in6 *)&sa;
        if (ip) inet_ntop(AF_INET6,(void*)&(s->sin6_addr),ip,ip_len);
        if (port) *port = ntohs(s->sin6_port);
    } else if (sa.ss_family == AF_UNIX) {
        if (ip) strncpy(ip,"/unixsocket",ip_len);
        if (port) *port = 0;
    } else {
        goto error;
    }
    return 0;

error:
    if (ip) {
        if (ip_len >= 2) {
            ip[0] = '?';
            ip[1] = '\0';
        } else if (ip_len == 1) {
            ip[0] = '\0';
        }
    }
    if (port) *port = 0;
    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r14
leaq 0xc(%rsp), %rdx
movl $0x80, (%rdx)
leaq 0x10(%rsp), %rsi
callq 0x101a0
testq %r15, %r15
je 0x155de
cmpl $-0x1, %eax
je 0x155de
movzwl 0x10(%rsp), %eax
cmpl $0x1, %eax
je 0x15636
cmpl $0xa, %eax
je 0x1560a
cmpl $0x2, %eax
jne 0x155de
testq %r14, %r14
je 0x15624
leaq 0x14(%rsp), %rsi
movl $0x2, %edi
jmp 0x15619
testq %r14, %r14
je 0x155fc
cmpq $0x2, %r15
jb 0x155f2
movb $0x3f, (%r14)
incq %r14
jmp 0x155f8
cmpq $0x1, %r15
jne 0x155fc
movb $0x0, (%r14)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rbx, %rbx
je 0x1565e
xorl %ecx, %ecx
jmp 0x15659
testq %r14, %r14
je 0x15624
leaq 0x18(%rsp), %rsi
movl $0xa, %edi
movq %r14, %rdx
movl %r15d, %ecx
callq 0x10040
testq %rbx, %rbx
je 0x1566b
movzwl 0x12(%rsp), %ecx
rolw $0x8, %cx
xorl %eax, %eax
jmp 0x15659
testq %r14, %r14
je 0x1564d
leaq 0x2aaa6(%rip), %rsi     # 0x400e8
movq %r14, %rdi
movq %r15, %rdx
callq 0x100b0
xorl %ecx, %ecx
movl $0x0, %eax
testq %rbx, %rbx
je 0x1565e
movzwl %cx, %ecx
movl %ecx, (%rbx)
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
jmp 0x1565e
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/anet.c
// Function: anetFormatPeer
int anetFormatPeer(int fd, char *buf, size_t buf_len) {
    char ip[INET6_ADDRSTRLEN];
    int port;

    anetPeerToString(fd,ip,sizeof(ip),&port);
    return anetFormatAddr(buf, buf_len, ip, port);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
movl $0x2e, %edx
movq %r15, %rsi
movq %r12, %rcx
callq 0x15585
movl (%r12), %ebp
movq %r15, %rdi
movl $0x3a, %esi
callq 0x101e0
testq %rax, %rax
leaq 0x2a9f3(%rip), %rax     # 0x400fc
leaq 0x2a9e4(%rip), %rdx     # 0x400f4
cmoveq %rax, %rdx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rcx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x10200
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/anet.c
// Function: anetSockName
int anetSockName(int fd, char *ip, size_t ip_len, int *port) {
    struct sockaddr_storage sa;
    socklen_t salen = sizeof(sa);

    if (getsockname(fd,(struct sockaddr*)&sa,&salen) == -1) {
        if (port) *port = 0;
        ip[0] = '?';
        ip[1] = '\0';
        return -1;
    }
    if (sa.ss_family == AF_INET) {
        struct sockaddr_in *s = (struct sockaddr_in *)&sa;
        if (ip) inet_ntop(AF_INET,(void*)&(s->sin_addr),ip,ip_len);
        if (port) *port = ntohs(s->sin_port);
    } else {
        struct sockaddr_in6 *s = (struct sockaddr_in6 *)&sa;
        if (ip) inet_ntop(AF_INET6,(void*)&(s->sin6_addr),ip,ip_len);
        if (port) *port = ntohs(s->sin6_port);
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r14
leaq 0xc(%rsp), %rdx
movl $0x80, (%rdx)
leaq 0x10(%rsp), %rsi
callq 0x105e0
cmpl $-0x1, %eax
je 0x1577c
cmpw $0x2, 0x10(%rsp)
jne 0x15794
testq %r14, %r14
je 0x157ae
leaq 0x14(%rsp), %rsi
movl $0x2, %edi
jmp 0x157a3
testq %rbx, %rbx
je 0x15787
movl $0x0, (%rbx)
movw $0x3f, (%r14)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x157c3
testq %r14, %r14
je 0x157ae
leaq 0x18(%rsp), %rsi
movl $0xa, %edi
movq %r14, %rdx
movl %r15d, %ecx
callq 0x10040
xorl %eax, %eax
testq %rbx, %rbx
je 0x157c3
movzwl 0x12(%rsp), %ecx
rolw $0x8, %cx
movzwl %cx, %ecx
movl %ecx, (%rbx)
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/anet.c
// Function: anetFormatSock
int anetFormatSock(int fd, char *fmt, size_t fmt_len) {
    char ip[INET6_ADDRSTRLEN];
    int port;

    anetSockName(fd,ip,sizeof(ip),&port);
    return anetFormatAddr(fmt, fmt_len, ip, port);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
movl $0x2e, %edx
movq %r15, %rsi
movq %r12, %rcx
callq 0x15734
movl (%r12), %ebp
movq %r15, %rdi
movl $0x3a, %esi
callq 0x101e0
testq %rax, %rax
leaq 0x2a8e5(%rip), %rax     # 0x400fc
leaq 0x2a8d6(%rip), %rdx     # 0x400f4
cmoveq %rax, %rdx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rcx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x10200
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/anet.c
// Function: anetSetReuseAddr
static int anetSetReuseAddr(char *err, int fd) {
    int yes = 1;
    /* Make sure connection-intensive things like the redis benckmark
     * will be able to close/open sockets a zillion of times */
    if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) == -1) {
        anetSetError(err, "setsockopt SO_REUSEADDR: %s", strerror(errno));
        return ANET_ERR;
    }
    return ANET_OK;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0xc(%rsp), %rcx
movl $0x1, (%rcx)
movl %esi, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x10120
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
jne 0x1589a
callq 0x100a0
movl (%rax), %edi
callq 0x10690
leaq 0x2a8b2(%rip), %rsi     # 0x4013a
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x14915
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/adlist.c
// Function: listRelease
void listRelease(list *list)
{
    unsigned long len;
    listNode *current, *next;

    current = list->head;
    len = list->len;
    while(len--) {
        next = current->next;
        if (list->free) list->free(current->value);
        zfree(current);
        current = next;
    }
    zfree(list);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %r15
testq %r15, %r15
je 0x158fd
movq (%rbx), %r14
movq 0x8(%r14), %r12
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x158ea
movq 0x10(%r14), %rdi
callq *%rax
decq %r15
movq %r14, %rdi
callq 0x1a877
movq %r12, %r14
testq %r15, %r15
jne 0x158d7
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1a877
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/adlist.c
// Function: listAddNodeHead
list *listAddNodeHead(list *list, void *value)
{
    listNode *node;

    if ((node = zmalloc(sizeof(*node))) == NULL)
        return NULL;
    node->value = value;
    if (list->len == 0) {
        list->head = list->tail = node;
        node->prev = node->next = NULL;
    } else {
        node->prev = NULL;
        node->next = list->head;
        list->head->prev = node;
        list->head = node;
    }
    list->len++;
    return list;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x18, %edi
callq 0x1a735
testq %rax, %rax
je 0x15945
movq %r14, 0x10(%rax)
movq 0x28(%rbx), %rcx
testq %rcx, %rcx
je 0x15949
movq $0x0, (%rax)
movq (%rbx), %rdx
movq %rax, (%rdx)
jmp 0x15956
xorl %ebx, %ebx
jmp 0x15964
movq %rax, 0x8(%rbx)
movq $0x0, (%rax)
xorl %edx, %edx
movq %rax, (%rbx)
movq %rdx, 0x8(%rax)
incq %rcx
movq %rcx, 0x28(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/adlist.c
// Function: listAddNodeTail
list *listAddNodeTail(list *list, void *value)
{
    listNode *node;

    if ((node = zmalloc(sizeof(*node))) == NULL)
        return NULL;
    node->value = value;
    if (list->len == 0) {
        list->head = list->tail = node;
        node->prev = node->next = NULL;
    } else {
        node->prev = list->tail;
        node->next = NULL;
        list->tail->next = node;
        list->tail = node;
    }
    list->len++;
    return list;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x18, %edi
callq 0x1a735
testq %rax, %rax
je 0x159ab
movq %r14, 0x10(%rax)
movq 0x28(%rbx), %rcx
testq %rcx, %rcx
je 0x159af
movq 0x8(%rbx), %rdx
movq $0x0, 0x8(%rax)
movq %rax, 0x8(%rdx)
movq %rax, 0x8(%rbx)
jmp 0x159c0
xorl %ebx, %ebx
jmp 0x159ca
movq %rax, 0x8(%rbx)
movq %rax, (%rbx)
movq $0x0, 0x8(%rax)
xorl %edx, %edx
movq %rdx, (%rax)
incq %rcx
movq %rcx, 0x28(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/adlist.c
// Function: listInsertNode
list *listInsertNode(list *list, listNode *old_node, void *value, int after) {
    listNode *node;

    if ((node = zmalloc(sizeof(*node))) == NULL)
        return NULL;
    node->value = value;
    if (after) {
        node->prev = old_node;
        node->next = old_node->next;
        if (list->tail == old_node) {
            list->tail = node;
        }
    } else {
        node->next = old_node;
        node->prev = old_node->prev;
        if (list->head == old_node) {
            list->head = node;
        }
    }
    if (node->prev != NULL) {
        node->prev->next = node;
    }
    if (node->next != NULL) {
        node->next->prev = node;
    }
    list->len++;
    return list;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movl $0x18, %edi
callq 0x1a735
testq %rax, %rax
je 0x15a18
movq %r15, 0x10(%rax)
testl %ebp, %ebp
je 0x15a1c
movq %r14, (%rax)
movq 0x8(%r14), %rcx
movq %rcx, 0x8(%rax)
cmpq %r14, 0x8(%rbx)
jne 0x15a13
movq %rax, 0x8(%rbx)
movq %r14, %rcx
jmp 0x15a33
xorl %ebx, %ebx
jmp 0x15a47
movq %r14, 0x8(%rax)
movq (%r14), %rcx
movq %rcx, (%rax)
cmpq %r14, (%rbx)
jne 0x15a2e
movq %rax, (%rbx)
testq %rcx, %rcx
je 0x15a40
movq %rax, 0x8(%rcx)
movq 0x8(%rax), %r14
testq %r14, %r14
je 0x15a43
movq %rax, (%r14)
incq 0x28(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/adlist.c
// Function: listDelNode
void listDelNode(list *list, listNode *node)
{
    if (node->prev)
        node->prev->next = node->next;
    else
        list->head = node->next;
    if (node->next)
        node->next->prev = node->prev;
    else
        list->tail = node->prev;
    if (list->free) list->free(node->value);
    zfree(node);
    list->len--;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
leaq 0x8(%rax), %rdx
testq %rax, %rax
cmoveq %rdi, %rdx
leaq 0x8(%rdi), %rsi
testq %rcx, %rcx
cmovneq %rcx, %rsi
movq %rcx, (%rdx)
movq %rax, (%rsi)
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x15a91
movq 0x10(%r14), %rdi
callq *%rax
movq %r14, %rdi
callq 0x1a877
decq 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/adlist.c
// Function: listDup
list *listDup(list *orig)
{
    list *copy;
    listIter iter;
    listNode *node;

    if ((copy = listCreate()) == NULL)
        return NULL;
    copy->dup = orig->dup;
    copy->free = orig->free;
    copy->match = orig->match;
    listRewind(orig, &iter);
    while((node = listNext(&iter)) != NULL) {
        void *value;

        if (copy->dup) {
            value = copy->dup(node->value);
            if (value == NULL) {
                listRelease(copy);
                return NULL;
            }
        } else
            value = node->value;
        if (listAddNodeTail(copy, value) == NULL) {
            listRelease(copy);
            return NULL;
        }
    }
    return copy;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x30, %edi
callq 0x1a735
testq %rax, %rax
je 0x15b87
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movups 0x10(%r14), %xmm0
movups %xmm0, 0x10(%rax)
movq 0x20(%r14), %rax
movq %rax, 0x20(%rbx)
movq (%r14), %rcx
testq %rcx, %rcx
je 0x15b89
movq 0x8(%rcx), %r14
movq 0x10(%rcx), %rax
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0x15b6c
movq %rax, %rdi
callq *%rcx
testq %rax, %rax
je 0x15b7f
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1596f
movq %r14, %rcx
testq %rax, %rax
jne 0x15b4c
movq %rbx, %rdi
callq 0x158c0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/adlist.c
// Function: listSearchKey
listNode *listSearchKey(list *list, void *key)
{
    listIter iter;
    listNode *node;

    listRewind(list, &iter);
    while((node = listNext(&iter)) != NULL) {
        if (list->match) {
            if (list->match(node->value, key)) {
                return node;
            }
        } else {
            if (key == node->value) {
                return node;
            }
        }
    }
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %rbx
testq %rbx, %rbx
je 0x15bd3
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rbx), %r12
movq 0x10(%rbx), %rdi
movq 0x20(%r15), %rax
testq %rax, %rax
je 0x15bc6
movq %r14, %rsi
callq *%rax
testl %eax, %eax
je 0x15bcb
jmp 0x15bd5
cmpq %r14, %rdi
je 0x15bd5
movq %r12, %rbx
testq %r12, %r12
jne 0x15baa
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/adlist.c
// Function: listIndex
listNode *listIndex(list *list, long index) {
    listNode *n;

    if (index < 0) {
        index = (-index)-1;
        n = list->tail;
        while(index-- && n) n = n->prev;
    } else {
        n = list->head;
        while(index-- && n) n = n->next;
    }
    return n;
}

// Assembly:
movq %rdi, %rax
testq %rsi, %rsi
js 0x15c13
movq (%rax), %rax
setne %cl
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x15c2a
decq %rsi
movq 0x8(%rax), %rax
addq $-0x1, %rsi
jae 0x15c2a
testq %rax, %rax
jne 0x15c02
jmp 0x15c2a
addq $0x8, %rax
incq %rsi
movq (%rax), %rax
testq %rsi, %rsi
je 0x15c2a
incq %rsi
testq %rax, %rax
jne 0x15c1a
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/adlist.c
// Function: listRotate
void listRotate(list *list) {
    listNode *tail = list->tail;

    if (listLength(list) <= 1) return;

    /* Detach current tail */
    list->tail = tail->prev;
    list->tail->next = NULL;
    /* Move it as head */
    list->head->prev = tail;
    tail->prev = NULL;
    tail->next = list->head;
    list->head = tail;
}

// Assembly:
cmpq $0x2, 0x28(%rdi)
jb 0x15c53
movq 0x8(%rdi), %rax
movq (%rax), %rcx
movq %rcx, 0x8(%rdi)
xorl %edx, %edx
movq %rdx, 0x8(%rcx)
movq (%rdi), %rcx
movq %rax, (%rcx)
movq %rdx, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: sdscatcolor
sds sdscatcolor(sds o, char *s, size_t len, char *color) {
    if (!isColorTerm()) return sdscatlen(o,s,len);

    int bold = strstr(color,"bold") != NULL;
    int ccode = 37; /* Defaults to white. */
    if (strstr(color,"red")) ccode = 31;
    else if (strstr(color,"red")) ccode = 31;
    else if (strstr(color,"green")) ccode = 32;
    else if (strstr(color,"yellow")) ccode = 33;
    else if (strstr(color,"blue")) ccode = 34;
    else if (strstr(color,"magenta")) ccode = 35;
    else if (strstr(color,"cyan")) ccode = 36;
    else if (strstr(color,"white")) ccode = 37;

    o = sdscatfmt(o,"\033[%i;%i;49m",bold,ccode);
    o = sdscatlen(o,s,len);
    o = sdscat(o,"\033[0m");
    return o;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0x15c54
testl %eax, %eax
je 0x15d8c
leaq 0x2e077(%rip), %rsi     # 0x43d25
movq %r12, %rdi
callq 0x106c0
xorl %ebp, %ebp
testq %rax, %rax
setne %bpl
leaq 0x2e064(%rip), %rsi     # 0x43d2a
movq %r12, %rdi
callq 0x106c0
movl $0x1f, %ecx
testq %rax, %rax
jne 0x15d54
leaq 0x2e04f(%rip), %rsi     # 0x43d2e
movq %r12, %rdi
callq 0x106c0
movl $0x20, %ecx
testq %rax, %rax
jne 0x15d54
leaq 0x2e03c(%rip), %rsi     # 0x43d34
movq %r12, %rdi
callq 0x106c0
movl $0x21, %ecx
testq %rax, %rax
jne 0x15d54
leaq 0x2e02a(%rip), %rsi     # 0x43d3b
movq %r12, %rdi
callq 0x106c0
movl $0x22, %ecx
testq %rax, %rax
jne 0x15d54
leaq 0x2e016(%rip), %rsi     # 0x43d40
movq %r12, %rdi
callq 0x106c0
movl $0x23, %ecx
testq %rax, %rax
jne 0x15d54
leaq 0x2e005(%rip), %rsi     # 0x43d48
movq %r12, %rdi
callq 0x106c0
xorl %ecx, %ecx
cmpq $0x1, %rax
adcl $0x24, %ecx
leaq 0x2dff8(%rip), %rsi     # 0x43d53
movq %r15, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x1e68e
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1e1ae
leaq 0x2fe7b(%rip), %rsi     # 0x45bf7
movq %rax, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1e279
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1e1ae
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: sdsCatColorizedLdbReply
sds sdsCatColorizedLdbReply(sds o, char *s, size_t len) {
    char *color = "white";

    if (strstr(s,"<debug>")) color = "bold";
    if (strstr(s,"<redis>")) color = "green";
    if (strstr(s,"<reply>")) color = "cyan";
    if (strstr(s,"<error>")) color = "red";
    if (strstr(s,"<hint>")) color = "bold";
    if (strstr(s,"<value>") || strstr(s,"<retval>")) color = "magenta";
    if (len > 4 && isdigit(s[3])) {
        if (s[1] == '>') color = "yellow"; /* Current line. */
        else if (s[2] == '#') color = "bold"; /* Break point. */
    }
    return sdscatcolor(o,s,len,color);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x2dfc9(%rip), %rsi     # 0x43d86
movq %r14, %rdi
callq 0x106c0
testq %rax, %rax
jne 0x15e82
leaq 0x2dfaa(%rip), %rsi     # 0x43d7f
movq %r14, %rdi
callq 0x106c0
movq %rax, (%rsp)
leaq 0x2df8f(%rip), %rsi     # 0x43d77
movq %r14, %rdi
callq 0x106c0
movq %rax, %r12
leaq 0x2df75(%rip), %rsi     # 0x43d6f
movq %r14, %rdi
callq 0x106c0
movq %rax, %rbp
leaq 0x2df5b(%rip), %rsi     # 0x43d67
movq %r14, %rdi
callq 0x106c0
movq %rax, %r13
leaq 0x2df41(%rip), %rsi     # 0x43d5f
movq %r14, %rdi
callq 0x106c0
testq %rax, %rax
leaq 0x2df1d(%rip), %rax     # 0x43d4d
leaq 0x2deee(%rip), %rcx     # 0x43d25
cmovneq %rcx, %rax
testq %r13, %r13
leaq 0x2dee9(%rip), %rdx     # 0x43d2e
cmoveq %rax, %rdx
testq %rbp, %rbp
leaq 0x2def5(%rip), %rax     # 0x43d48
cmoveq %rdx, %rax
testq %r12, %r12
leaq 0x2dec9(%rip), %r12     # 0x43d2a
cmoveq %rax, %r12
cmpq $0x0, (%rsp)
cmovneq %rcx, %r12
leaq 0x2df19(%rip), %rsi     # 0x43d8e
movq %r14, %rdi
callq 0x106c0
testq %rax, %rax
je 0x15e89
leaq 0x2deb7(%rip), %r12     # 0x43d40
cmpq $0x5, %rbx
jb 0x15ec3
callq 0x10710
movq (%rax), %rax
movsbq 0x3(%r14), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x15ec3
cmpb $0x3e, 0x1(%r14)
jne 0x15eb3
leaq 0x2de83(%rip), %r12     # 0x43d34
jmp 0x15ec3
cmpb $0x23, 0x2(%r14)
leaq 0x2de66(%rip), %rax     # 0x43d25
cmoveq %rax, %r12
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r12, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x15c86
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: cliSetPreferences
void cliSetPreferences(char **argv, int argc, int interactive) {
    if (!strcasecmp(argv[0],":set") && argc >= 2) {
        if (!strcasecmp(argv[1],"hints")) pref.hints = 1;
        else if (!strcasecmp(argv[1],"nohints")) pref.hints = 0;
        else {
            printf("%sunknown redis-cli preference '%s'\n",
                interactive ? "" : ".redisclirc: ",
                argv[1]);
        }
    } else {
        printf("%sunknown redis-cli internal command '%s'\n",
            interactive ? "" : ".redisclirc: ",
            argv[0]);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r15
movq (%rdi), %r14
leaq 0x2de9d(%rip), %rsi     # 0x43d97
movq %r14, %rdi
callq 0x10080
cmpl $0x2, %ebp
jl 0x15f52
testl %eax, %eax
jne 0x15f52
movq 0x8(%r15), %r14
leaq 0x2de88(%rip), %rsi     # 0x43d9e
movq %r14, %rdi
callq 0x10080
testl %eax, %eax
je 0x15f81
leaq 0x2de73(%rip), %rsi     # 0x43d9c
movq %r14, %rdi
callq 0x10080
testl %eax, %eax
je 0x15f8a
testl %ebx, %ebx
leaq 0x2de8b(%rip), %rax     # 0x43dc9
leaq 0x2f34b(%rip), %rsi     # 0x45290
cmoveq %rax, %rsi
leaq 0x2de54(%rip), %rdi     # 0x43da4
jmp 0x15f6d
testl %ebx, %ebx
leaq 0x2de6e(%rip), %rax     # 0x43dc9
leaq 0x2f32e(%rip), %rsi     # 0x45290
cmoveq %rax, %rsi
leaq 0x2de6a(%rip), %rdi     # 0x43dd7
movq %r14, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x101f0
movb $0x1, 0x44470(%rip)     # 0x5a3f8
jmp 0x15f91
movb $0x0, 0x44467(%rip)     # 0x5a3f8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: cliLoadPreferences
void cliLoadPreferences(void) {
    sds rcfile = getDotfilePath(REDIS_CLI_RCFILE_ENV,REDIS_CLI_RCFILE_DEFAULT);
    if (rcfile == NULL) return;
    FILE *fp = fopen(rcfile,"r");
    char buf[1024];

    if (fp) {
        while(fgets(buf,sizeof(buf),fp) != NULL) {
            sds *argv;
            int argc;

            argv = sdssplitargs(buf,&argc);
            if (argc > 0) cliSetPreferences(argv,argc,0);
            sdsfreesplitres(argv,argc);
        }
        fclose(fp);
    }
    sdsfree(rcfile);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x410, %rsp            # imm = 0x410
leaq 0x2de4f(%rip), %rdi     # 0x43e02
leaq 0x2de58(%rip), %rsi     # 0x43e12
callq 0x16065
testq %rax, %rax
je 0x16054
movq %rax, %rbx
leaq 0x3134b(%rip), %rsi     # 0x4731d
movq %rax, %rdi
callq 0x103e0
testq %rax, %rax
je 0x1604c
movq %rax, %r14
leaq 0x10(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
movq %rax, %rdx
callq 0x10330
testq %rax, %rax
je 0x16044
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x1f4e7
movq %rax, %r13
movl 0xc(%rsp), %esi
testl %esi, %esi
jle 0x16027
movq %r13, %rdi
xorl %edx, %edx
callq 0x15ee2
movl 0xc(%rsp), %esi
movq %r13, %rdi
callq 0x1f2e1
movq %r15, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdx
callq 0x10330
testq %rax, %rax
jne 0x16003
movq %r14, %rdi
callq 0x101b0
movq %rbx, %rdi
callq 0x1da09
addq $0x410, %rsp            # imm = 0x410
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: getDotfilePath
static sds getDotfilePath(char *envoverride, char *dotfilename) {
    char *path = NULL;
    sds dotPath = NULL;

    /* Check the env for a dotfile override. */
    path = getenv(envoverride);
    if (path != NULL && *path != '\0') {
        if (!strcmp("/dev/null", path)) {
            return NULL;
        }

        /* If the env is set, return it. */
        dotPath = sdsnew(path);
    } else {
        char *home = getenv("HOME");
        if (home != NULL && *home != '\0') {
            /* If no override is set use $HOME/<dotfilename>. */
            dotPath = sdscatprintf(sdsempty(), "%s/%s", home, dotfilename);
        }
    }
    return dotPath;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
callq 0x10050
testq %rax, %rax
je 0x160a0
movq %rax, %r14
cmpb $0x0, (%rax)
je 0x160a0
leaq 0x2de68(%rip), %rdi     # 0x43eed
movq %r14, %rsi
callq 0x10380
testl %eax, %eax
je 0x160dc
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1d989
leaq 0x2de50(%rip), %rdi     # 0x43ef7
callq 0x10050
testq %rax, %rax
je 0x160dc
movq %rax, %r14
cmpb $0x0, (%rax)
je 0x160dc
callq 0x1d966
leaq 0x2de37(%rip), %rsi     # 0x43efc
movq %rax, %rdi
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1e60a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: showLatencyDistSamples
void showLatencyDistSamples(struct distsamples *samples, long long tot) {
    int j;

     /* We convert samples into a index inside the palette
     * proportional to the percentage a given bucket represents.
     * This way intensity of the different parts of the spectrum
     * don't change relative to the number of requests, which avoids to
     * pollute the visualization with non-latency related info. */
    printf("\033[38;5;0m"); /* Set foreground color to black. */
    for (j = 0; ; j++) {
        int coloridx =
            ceil((float) samples[j].count / tot * (spectrum_palette_size-1));
        int color = spectrum_palette[coloridx];
        printf("\033[48;5;%dm%c", (int)color, samples[j].character);
        samples[j].count = 0;
        if (samples[j].max == 0) break; /* Last sample. */
    }
    printf("\033[0m\n");
    fflush(stdout);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x2dd27(%rip), %rdi     # 0x43e1e
xorl %eax, %eax
callq 0x101f0
cvtsi2ss %r14, %xmm0
movss %xmm0, 0x4(%rsp)
addq $0x10, %rbx
leaq 0x2dd14(%rip), %r14     # 0x43e28
xorps %xmm1, %xmm1
cvtsi2ssq -0x8(%rbx), %xmm1
divss 0x4(%rsp), %xmm1
movl 0x442d3(%rip), %eax     # 0x5a3fc
decl %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss %xmm1, %xmm0
callq 0x10340
cvttss2si %xmm0, %eax
movq 0x442ba(%rip), %rcx     # 0x5a400
cltq
movl (%rcx,%rax,4), %esi
movl (%rbx), %edx
movq %r14, %rdi
xorl %eax, %eax
callq 0x101f0
movq $0x0, -0x8(%rbx)
cmpq $0x0, -0x10(%rbx)
leaq 0x18(%rbx), %rbx
jne 0x16114
leaq 0x2fa86(%rip), %rdi     # 0x45bf7
callq 0x100e0
movq 0x41e43(%rip), %rax     # 0x57fc0
movq (%rax), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x10470
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: showLatencyDistLegend
void showLatencyDistLegend(void) {
    int j;

    printf("---------------------------------------------\n");
    printf(". - * #          .01 .125 .25 .5 milliseconds\n");
    printf("1,2,3,...,9      from 1 to 9     milliseconds\n");
    printf("A,B,C,D,E        10,20,30,40,50  milliseconds\n");
    printf("F,G,H,I,J        .1,.2,.3,.4,.5       seconds\n");
    printf("K,L,M,N,O,P,Q,?  1,2,4,8,16,30,60,>60 seconds\n");
    printf("From 0 to 100%%: ");
    for (j = 0; j < spectrum_palette_size; j++) {
        printf("\033[48;5;%dm ", spectrum_palette[j]);
    }
    printf("\033[0m\n");
    printf("---------------------------------------------\n");
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x2fa65(%rip), %rdi     # 0x45bfc
callq 0x100e0
leaq 0x2f96e(%rip), %rdi     # 0x45b11
callq 0x100e0
leaq 0x2f990(%rip), %rdi     # 0x45b3f
callq 0x100e0
leaq 0x2f9b2(%rip), %rdi     # 0x45b6d
callq 0x100e0
leaq 0x2f9d4(%rip), %rdi     # 0x45b9b
callq 0x100e0
leaq 0x2f9f6(%rip), %rdi     # 0x45bc9
callq 0x100e0
leaq 0x2dc56(%rip), %rdi     # 0x43e35
xorl %eax, %eax
callq 0x101f0
cmpl $0x0, 0x4420f(%rip)     # 0x5a3fc
jle 0x1621d
leaq 0x2dc51(%rip), %rbx     # 0x43e47
xorl %r14d, %r14d
movq 0x44200(%rip), %rax     # 0x5a400
movl (%rax,%r14,4), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x101f0
incq %r14
movslq 0x441e4(%rip), %rax     # 0x5a3fc
cmpq %rax, %r14
jl 0x161f9
leaq 0x2f9d3(%rip), %rdi     # 0x45bf7
callq 0x100e0
leaq 0x2f9cc(%rip), %rdi     # 0x45bfc
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x100e0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: sendSync
unsigned long long sendSync(int fd) {
    /* To start we need to send the SYNC command and return the payload.
     * The hiredis client lib does not understand this part of the protocol
     * and we don't want to mess with its buffers, so everything is performed
     * using direct low-level I/O. */
    char buf[4096], *p;
    ssize_t nread;

    /* Send the SYNC command. */
    if (write(fd,"SYNC\r\n",6) != 6) {
        fprintf(stderr,"Error writing to master\n");
        exit(1);
    }

    /* Read $<payload>\r\n, making sure to read just up to "\n" */
    p = buf;
    while(1) {
        nread = read(fd,p,1);
        if (nread <= 0) {
            fprintf(stderr,"Error reading bulk length while SYNCing\n");
            exit(1);
        }
        if (*p == '\n' && p != buf) break;
        if (*p != '\n') p++;
    }
    *p = '\0';
    if (buf[0] == '-') {
        printf("SYNC with master failed: %s\n", buf);
        exit(1);
    }
    return strtoull(buf+1,NULL,10);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movl %edi, %ebx
leaq 0x2dc02(%rip), %rsi     # 0x43e53
movl $0x6, %edx
callq 0x10170
cmpq $0x6, %rax
jne 0x162d8
movq %rsp, %r14
movl $0x1, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x102f0
testq %rax, %rax
jle 0x162ab
movq %r14, %r15
movb (%r15), %al
cmpb $0xa, %al
sete %cl
cmpq %r14, %r15
setne %dl
testb %cl, %dl
jne 0x162b0
xorl %ecx, %ecx
cmpb $0xa, %al
setne %cl
addq %rcx, %r15
movl $0x1, %edx
movl %ebx, %edi
movq %r15, %rsi
callq 0x102f0
testq %rax, %rax
jg 0x1627b
callq 0x1085e
movb $0x0, (%r15)
cmpb $0x2d, (%rsp)
je 0x162dd
leaq 0x1(%rsp), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x10360
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %r15
retq
callq 0x10839
leaq 0x2dbb8(%rip), %rdi     # 0x43e9c
movq %rsp, %rsi
xorl %eax, %eax
callq 0x101f0
movl $0x1, %edi
callq 0x10630
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: bytesToHuman
void bytesToHuman(char *s, long long n) {
    double d;

    if (n < 0) {
        *s = '-';
        s++;
        n = -n;
    }
    if (n < 1024) {
        /* Bytes */
        sprintf(s,"%lldB",n);
        return;
    } else if (n < (1024*1024)) {
        d = (double)n/(1024);
        sprintf(s,"%.2fK",d);
    } else if (n < (1024LL*1024*1024)) {
        d = (double)n/(1024*1024);
        sprintf(s,"%.2fM",d);
    } else if (n < (1024LL*1024*1024*1024)) {
        d = (double)n/(1024LL*1024*1024);
        sprintf(s,"%.2fG",d);
    }
}

// Assembly:
movq %rsi, %rdx
testq %rsi, %rsi
jns 0x16309
movb $0x2d, (%rdi)
incq %rdi
negq %rdx
cmpq $0x3ff, %rdx            # imm = 0x3FF
ja 0x16320
leaq 0x2dba0(%rip), %rsi     # 0x43eb9
xorl %eax, %eax
jmp 0x10620
cmpq $0xfffff, %rdx          # imm = 0xFFFFF
ja 0x1633f
cvtsi2sd %rdx, %xmm0
mulsd 0x29e7a(%rip), %xmm0    # 0x401b0
leaq 0x2db82(%rip), %rsi     # 0x43ebf
jmp 0x1637b
cmpq $0x3fffffff, %rdx       # imm = 0x3FFFFFFF
ja 0x1635e
cvtsi2sd %rdx, %xmm0
mulsd 0x29e53(%rip), %xmm0    # 0x401a8
leaq 0x2db69(%rip), %rsi     # 0x43ec5
jmp 0x1637b
movq %rdx, %rax
shrq $0x28, %rax
jne 0x16382
cvtsi2sd %rdx, %xmm0
mulsd 0x29e2c(%rip), %xmm0    # 0x401a0
leaq 0x2db50(%rip), %rsi     # 0x43ecb
movb $0x1, %al
jmp 0x10620
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: powerLawRand
long long powerLawRand(long long min, long long max, double alpha) {
    double pl, r;

    max += 1;
    r = ((double)rand()) / RAND_MAX;
    pl = pow(
        ((pow(max,alpha+1) - pow(min,alpha+1))*r + pow(min,alpha+1)),
        (1.0/(alpha+1)));
    return (max-1-(long long)pl)+min;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movsd %xmm0, (%rsp)
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1(%rsi), %r15
callq 0x106e0
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x29e09(%rip), %xmm0    # 0x401b8
movsd %xmm0, 0x18(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %r15, %xmm0
movsd (%rsp), %xmm1
addsd 0x29df6(%rip), %xmm1    # 0x401c0
movsd %xmm1, (%rsp)
callq 0x10190
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd (%rsp), %xmm1
callq 0x10190
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
mulsd 0x18(%rsp), %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
movsd (%rsp), %xmm1
callq 0x10190
addsd 0x8(%rsp), %xmm0
movsd 0x29d9a(%rip), %xmm1    # 0x401c0
divsd (%rsp), %xmm1
callq 0x10190
cvttsd2si %xmm0, %rax
addq %r14, %rbx
subq %rax, %rbx
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: compute_something_fast
unsigned long compute_something_fast(void) {
    unsigned char s[256], i, j, t;
    int count = 1000, k;
    unsigned long output = 0;

    for (k = 0; k < 256; k++) s[k] = k;

    i = 0;
    j = 0;
    while(count--) {
        i++;
        j = j + s[i];
        t = s[i];
        s[i] = s[j];
        s[j] = t;
        output += s[(s[i]+s[j])&255];
    }
    return output;
}

// Assembly:
subq $0x88, %rsp
movdqa 0x29d15(%rip), %xmm0    # 0x40200
xorl %eax, %eax
movdqa 0x29d1b(%rip), %xmm1    # 0x40210
movdqa %xmm0, -0x80(%rsp,%rax)
addq $0x10, %rax
paddb %xmm1, %xmm0
cmpq $0x100, %rax            # imm = 0x100
jne 0x164f5
xorl %eax, %eax
movl $0xfffffc18, %ecx       # imm = 0xFFFFFC18
movl $0xff, %edx
xorl %esi, %esi
leal 0x3e9(%rcx), %edi
andl %edx, %edi
movzbl -0x80(%rsp,%rdi), %r8d
addl %r8d, %esi
movl %esi, %r9d
andl %edx, %r9d
movb -0x80(%rsp,%r9), %r10b
movb %r10b, -0x80(%rsp,%rdi)
movb %r8b, -0x80(%rsp,%r9)
movb -0x80(%rsp,%rdi), %dil
addb %r8b, %dil
movzbl %dil, %edi
movzbl -0x80(%rsp,%rdi), %edi
addq %rdi, %rax
incl %ecx
jne 0x16519
addq $0x88, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: cliConnect
static int cliConnect(int force) {
    if (context == NULL || force) {
        if (context != NULL) {
            redisFree(context);
        }

        if (config.hostsocket == NULL) {
            context = redisConnect(config.hostip,config.hostport);
        } else {
            context = redisConnectUnix(config.hostsocket);
        }

        if (context->err) {
            fprintf(stderr,"Could not connect to Redis at ");
            if (config.hostsocket == NULL)
                fprintf(stderr,"%s:%d: %s\n",config.hostip,config.hostport,context->errstr);
            else
                fprintf(stderr,"%s: %s\n",config.hostsocket,context->errstr);
            redisFree(context);
            context = NULL;
            return REDIS_ERR;
        }

        /* Set aggressive KEEP_ALIVE socket option in the Redis context socket
         * in order to prevent timeouts caused by the execution of long
         * commands. At the same time this improves the detection of real
         * errors. */
        anetKeepAlive(NULL, context->fd, REDIS_CLI_KEEPALIVE_INTERVAL);

        /* Do AUTH and select the right DB. */
        if (cliAuth() != REDIS_OK)
            return REDIS_ERR;
        if (cliSelect() != REDIS_OK)
            return REDIS_ERR;
    }
    return REDIS_OK;
}

// Assembly:
pushq %rax
movl %edi, %eax
movq 0x41c08(%rip), %rdi     # 0x5a558
testq %rdi, %rdi
setne %cl
testl %eax, %eax
sete %al
testb %cl, %al
jne 0x189ee
testq %rdi, %rdi
je 0x1896d
callq 0x1c9fe
movq 0x41aa4(%rip), %rdi     # 0x5a418
testq %rdi, %rdi
je 0x18980
callq 0x1cb7a
jmp 0x18992
movq 0x41a81(%rip), %rdi     # 0x5a408
movl 0x41a83(%rip), %esi     # 0x5a410
callq 0x1ca56
movq %rax, 0x41bbf(%rip)     # 0x5a558
cmpl $0x0, (%rax)
jne 0x189f2
movl 0x84(%rax), %esi
xorl %edi, %edi
movl $0xf, %edx
callq 0x149be
movq 0x41ae9(%rip), %rdx     # 0x5a4a0
testq %rdx, %rdx
je 0x189de
movq 0x41b95(%rip), %rdi     # 0x5a558
leaq 0x2c398(%rip), %rsi     # 0x44d62
xorl %eax, %eax
callq 0x1d2d0
testq %rax, %rax
je 0x189f7
movq %rax, %rdi
callq 0x1b6f0
callq 0x1926d
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x189f0
xorl %eax, %eax
popq %rcx
retq
callq 0x10dad
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x189f0
// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: cliVersion
static sds cliVersion(void) {
    sds version;
    version = sdscatprintf(sdsempty(), "%s", REDIS_VERSION);

    /* Add git commit and working tree status when available */
    if (strtoll(redisGitSHA1(),NULL,16)) {
        version = sdscatprintf(version, " (git:%s", redisGitSHA1());
        if (strtoll(redisGitDirty(),NULL,10))
            version = sdscatprintf(version, "-dirty");
        version = sdscat(version, ")");
    }
    return version;
}

// Assembly:
pushq %rbx
callq 0x1d966
leaq 0x26e50(%rip), %rsi     # 0x40032
leaq 0x2bb30(%rip), %rdx     # 0x44d19
movq %rax, %rdi
xorl %eax, %eax
callq 0x1e60a
movq %rax, %rbx
callq 0x1ab60
movq %rax, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x103a0
testq %rax, %rax
je 0x19268
callq 0x1ab60
leaq 0x2bb05(%rip), %rsi     # 0x44d20
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1e60a
movq %rax, %rbx
callq 0x1ab68
movq %rax, %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x103a0
testq %rax, %rax
je 0x19258
leaq 0x2bade(%rip), %rsi     # 0x44d29
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1e60a
movq %rax, %rbx
leaq 0x2e0b4(%rip), %rsi     # 0x47313
movq %rbx, %rdi
popq %rbx
jmp 0x1e279
movq %rbx, %rax
popq %rbx
retq