LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/anet.c
// Function: anetTcpServer
static int _anetTcpServer(char *err, int port, char *bindaddr, int af, int backlog)
{
    int s, 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:
    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 0x2573f(%rip), %rdx     # 0x3917a
leaq 0x1a(%rsp), %r12
movl $0x6, %esi
movq %r12, %rdi
xorl %eax, %eax
callq 0xb1d0
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, 0x20(%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 0xb540
testl %eax, %eax
je 0x13aa7
movl %eax, %edi
callq 0xb1f0
leaq 0x255a6(%rip), %rsi     # 0x39038
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1315d
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x13af9
movq 0x8(%rsp), %r12
testq %r12, %r12
je 0x13ad1
movl 0x4(%r12), %edi
movl 0x8(%r12), %esi
movl 0xc(%r12), %edx
callq 0xb600
cmpl $-0x1, %eax
jne 0x13b09
movq 0x28(%r12), %r12
jmp 0x13aac
callq 0xb080
movl (%rax), %edx
leaq 0x2567d(%rip), %rsi     # 0x3915c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1315d
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movq 0x8(%rsp), %rdi
callq 0xb5f0
movl %r14d, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %r14d
cmpl $0xa, %r15d
jne 0x13b3a
leaq 0x14(%rsp), %rcx
movl $0x1, (%rcx)
movl %r14d, %edi
movl $0x29, %esi
movl $0x1a, %edx
movl $0x4, %r8d
callq 0xb100
cmpl $-0x1, %eax
je 0x13b69
movq %rbx, %rdi
movl %r14d, %esi
callq 0x14099
cmpl $-0x1, %eax
je 0x13ae9
movq 0x18(%r12), %rdx
movl 0x10(%r12), %ecx
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %r8d
callq 0x13c61
cmpl $-0x1, %eax
jne 0x13aef
jmp 0x13ae9
callq 0xb080
movl (%rax), %edi
callq 0xb560
leaq 0x25601(%rip), %rsi     # 0x3917d
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1315d
movl %r14d, %edi
callq 0xb240
jmp 0x13ae9
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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 $0x88, %rsp
movl %ecx, %r15d
movl %edx, 0xc(%rsp)
movq %rsi, %rbx
movq %rdi, %r13
callq 0x138f5
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpl $-0x1, %eax
je 0x13c4c
movl %eax, %ebp
xorps %xmm0, %xmm0
leaq 0x12(%rsp), %r12
movaps %xmm0, -0x2(%r12)
movups %xmm0, 0x5c(%r12)
movaps %xmm0, 0x4e(%r12)
movaps %xmm0, 0x3e(%r12)
movaps %xmm0, 0x2e(%r12)
movaps %xmm0, 0x1e(%r12)
movaps %xmm0, 0xe(%r12)
movw $0x1, -0x2(%r12)
movl $0x6b, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0xb0a0
leaq 0x10(%rsp), %rdx
movq %r13, %rdi
movl %ebp, %esi
movl $0x6e, %ecx
movl %r15d, %r8d
callq 0x13c61
cmpl $-0x1, %eax
je 0x13c4c
movl 0xc(%rsp), %esi
testl %esi, %esi
je 0x13c49
movq %r12, %rdi
callq 0xb410
movl %ebp, %r14d
movl %r14d, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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 0x13d65
cmpl $-0x1, %eax
je 0x13d21
movl %eax, %ebp
cmpw $0x2, 0x8(%rsp)
jne 0x13d28
testq %r15, %r15
je 0x13d42
leaq 0xc(%rsp), %rsi
movl $0x2, %edi
jmp 0x13d37
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x13d55
testq %r15, %r15
je 0x13d42
leaq 0x10(%rsp), %rsi
movl $0xa, %edi
movq %r15, %rdx
movl %r14d, %ecx
callq 0xb040
testq %rbx, %rbx
je 0x13d55
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_O1/zhou-yuxin[P]redis-aof-no-cow/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 %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %rbx
movl %ebp, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0xb4a0
cmpl $-0x1, %eax
jne 0x13db3
callq 0xb080
movl (%rax), %edi
cmpl $0x4, %edi
je 0x13d77
callq 0xb560
leaq 0x253f6(%rip), %rsi     # 0x39197
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1315d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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 0xb170
testq %r15, %r15
je 0x13e35
cmpl $-0x1, %eax
je 0x13e35
movzwl 0x10(%rsp), %eax
cmpl $0x1, %eax
je 0x13e8d
cmpl $0xa, %eax
je 0x13e61
cmpl $0x2, %eax
jne 0x13e35
testq %r14, %r14
je 0x13e7b
leaq 0x14(%rsp), %rsi
movl $0x2, %edi
jmp 0x13e70
testq %r14, %r14
je 0x13e53
cmpq $0x2, %r15
jb 0x13e49
movb $0x3f, (%r14)
incq %r14
jmp 0x13e4f
cmpq $0x1, %r15
jne 0x13e53
movb $0x0, (%r14)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rbx, %rbx
je 0x13eb5
xorl %ecx, %ecx
jmp 0x13eb0
testq %r14, %r14
je 0x13e7b
leaq 0x18(%rsp), %rsi
movl $0xa, %edi
movq %r14, %rdx
movl %r15d, %ecx
callq 0xb040
testq %rbx, %rbx
je 0x13ec2
movzwl 0x12(%rsp), %ecx
rolw $0x8, %cx
xorl %eax, %eax
jmp 0x13eb0
testq %r14, %r14
je 0x13ea4
leaq 0x25255(%rip), %rsi     # 0x390ee
movq %r14, %rdi
movq %r15, %rdx
callq 0xb0a0
xorl %ecx, %ecx
movl $0x0, %eax
testq %rbx, %rbx
je 0x13eb5
movzwl %cx, %ecx
movl %ecx, (%rbx)
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
jmp 0x13eb5
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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 0x13ddc
movl (%r12), %ebp
movq %r15, %rdi
movl $0x3a, %esi
callq 0xb1b0
testq %rax, %rax
leaq 0x251a2(%rip), %rax     # 0x39102
leaq 0x25193(%rip), %rdx     # 0x390fa
cmoveq %rax, %rdx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rcx
movl %ebp, %r8d
xorl %eax, %eax
callq 0xb1d0
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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 0xb4b0
cmpl $-0x1, %eax
je 0x13fd3
cmpw $0x2, 0x10(%rsp)
jne 0x13feb
testq %r14, %r14
je 0x14005
leaq 0x14(%rsp), %rsi
movl $0x2, %edi
jmp 0x13ffa
testq %rbx, %rbx
je 0x13fde
movl $0x0, (%rbx)
movw $0x3f, (%r14)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x1401a
testq %r14, %r14
je 0x14005
leaq 0x18(%rsp), %rsi
movl $0xa, %edi
movq %r14, %rdx
movl %r15d, %ecx
callq 0xb040
xorl %eax, %eax
testq %rbx, %rbx
je 0x1401a
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_O1/zhou-yuxin[P]redis-aof-no-cow/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 0x13f8b
movl (%r12), %ebp
movq %r15, %rdi
movl $0x3a, %esi
callq 0xb1b0
testq %rax, %rax
leaq 0x25094(%rip), %rax     # 0x39102
leaq 0x25085(%rip), %rdx     # 0x390fa
cmoveq %rax, %rdx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rcx
movl %ebp, %r8d
xorl %eax, %eax
callq 0xb1d0
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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 0xb100
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
jne 0x140f1
callq 0xb080
movl (%rax), %edi
callq 0xb560
leaq 0x25061(%rip), %rsi     # 0x39140
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1315d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/redis-benchmark.c
// Function: showThroughput
int showThroughput(struct aeEventLoop *eventLoop, long long id, void *clientData) {
    UNUSED(eventLoop);
    UNUSED(id);
    UNUSED(clientData);

    if (config.liveclients == 0) {
        fprintf(stderr,"All clients disconnected... aborting.\n");
        exit(1);
    }
    if (config.csv) return 250;
    if (config.idlemode == 1) {
        printf("clients: %d\r", config.liveclients);
        fflush(stdout);
	return 250;
    }
    float dt = (float)(mstime()-config.start)/1000.0;
    float rps = (float)config.requests_finished/dt;
    printf("%s: %.2f\r", config.title, rps);
    fflush(stdout);
    return 250; /* every 250ms */
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl 0x37f18(%rip), %esi     # 0x4c45c
testl %esi, %esi
je 0x145fb
cmpl $0x0, 0x37f61(%rip)     # 0x4c4b4
jne 0x145f0
cmpl $0x1, 0x37f5c(%rip)     # 0x4c4bc
jne 0x14572
leaq 0x24d6b(%rip), %rdi     # 0x392d4
xorl %eax, %eax
callq 0xb1c0
jmp 0x145e1
movq %rsp, %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xb200
imulq $0x3e8, (%rbx), %rcx    # imm = 0x3E8
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x8(%rbx)
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rdx
addq %rax, %rdx
addq %rcx, %rdx
subq 0x37edc(%rip), %rdx     # 0x4c488
cvtsi2ss %rdx, %xmm0
divss 0x24beb(%rip), %xmm0    # 0x391a4
cvtsi2ssl 0x37ea7(%rip), %xmm1 # 0x4c468
divss %xmm0, %xmm1
movq 0x37ed4(%rip), %rsi     # 0x4c4a0
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
leaq 0x24d07(%rip), %rdi     # 0x392e1
movb $0x1, %al
callq 0xb1c0
movq 0x379d8(%rip), %rax     # 0x4bfc0
movq (%rax), %rdi
callq 0xb3a0
movl $0xfa, %eax
addq $0x10, %rsp
popq %rbx
retq
callq 0xb620
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/redis-benchmark.c
// Function: test_is_selected
int test_is_selected(char *name) {
    char buf[256];
    int l = strlen(name);

    if (config.tests == NULL) return 1;
    buf[0] = ',';
    memcpy(buf+1,name,l);
    buf[l+1] = ',';
    buf[l+2] = '\0';
    return strstr(config.tests,buf) != NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq 0x37ebc(%rip), %rbx     # 0x4c4d0
testq %rbx, %rbx
je 0x14681
movq %rdi, %r14
callq 0xb190
movb $0x2c, %bpl
leaq 0x1(%rsp), %rdi
movb %bpl, -0x1(%rdi)
movslq %eax, %rdx
movq %rax, %r15
shlq $0x20, %r15
movq %r14, %rsi
callq 0xb340
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %r15, %rax
sarq $0x20, %rax
movb %bpl, (%rsp,%rax)
movabsq $0x200000000, %rax      # imm = 0x200000000
addq %r15, %rax
sarq $0x20, %rax
movb $0x0, (%rsp,%rax)
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xb590
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
setne %al
jmp 0x14686
movl $0x1, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/redis-benchmark.c
// Function: createMissingClients
static void createMissingClients(client c) {
    int n = 0;

    while(config.liveclients < config.numclients) {
        createClient(NULL,0,c);

        /* Listen backlog is quite limited on most systems */
        if (++n > 64) {
            usleep(50000);
            n = 0;
        }
    }
}

// Assembly:
movl 0x37302(%rip), %eax     # 0x4c45c
cmpl 0x372f8(%rip), %eax     # 0x4c458
jge 0x151a5
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %edi, %edi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x14de5
cmpl $0x40, %r14d
jge 0x15183
incl %r14d
jmp 0x15190
movl $0xc350, %edi           # imm = 0xC350
callq 0xb5e0
xorl %r14d, %r14d
movl 0x372c6(%rip), %eax     # 0x4c45c
cmpl 0x372bc(%rip), %eax     # 0x4c458
jl 0x1516c
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/redis-benchmark.c
// Function: freeClient
static void freeClient(client c) {
    listNode *ln;
    aeDeleteFileEvent(config.el,c->context->fd,AE_WRITABLE);
    aeDeleteFileEvent(config.el,c->context->fd,AE_READABLE);
    redisFree(c->context);
    sdsfree(c->obuf);
    zfree(c->randptr);
    zfree(c);
    config.liveclients--;
    ln = listSearchKey(config.clients,c);
    assert(ln != NULL);
    listDelNode(config.clients,ln);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x36dad(%rip), %rdi     # 0x4c438
movq (%rbx), %rax
movl 0x84(%rax), %esi
movl $0x2, %edx
callq 0x12a32
movq 0x36d93(%rip), %rdi     # 0x4c438
movq (%rbx), %rax
movl 0x84(%rax), %esi
movl $0x1, %edx
callq 0x12a32
movq (%rbx), %rdi
callq 0x174a8
movq 0x8(%rbx), %rdi
callq 0x18503
movq 0x10(%rbx), %rdi
callq 0x15e7b
movq %rbx, %rdi
callq 0x15e7b
decl 0x36d7c(%rip)           # 0x4c45c
movq 0x36dc1(%rip), %rdi     # 0x4c4a8
movq %rbx, %rsi
callq 0x15c6f
testq %rax, %rax
je 0x15704
movq 0x36dad(%rip), %rdi     # 0x4c4a8
movq %rax, %rsi
popq %rbx
jmp 0x15b10
leaq 0x23f12(%rip), %rdi     # 0x3961d
leaq 0x23f16(%rip), %rsi     # 0x39628
leaq 0x23f21(%rip), %rcx     # 0x3963a
movl $0x87, %edx
callq 0xb210
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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 0x159b9
movq (%rbx), %r14
movq 0x8(%r14), %r12
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x159a6
movq 0x10(%r14), %rdi
callq *%rax
decq %r15
movq %r14, %rdi
callq 0x15e7b
movq %r12, %r14
testq %r15, %r15
jne 0x15993
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x15e7b
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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 0x15d39
testq %rax, %rax
je 0x15a08
movq %r14, 0x10(%rax)
movq 0x28(%rbx), %rcx
testq %rcx, %rcx
je 0x15a0c
movq $0x0, (%rax)
movq (%rbx), %rdx
movq %rdx, 0x8(%rax)
movq %rax, (%rdx)
movq %rax, (%rbx)
jmp 0x15a19
xorl %ebx, %ebx
jmp 0x15a20
movq %rax, 0x8(%rbx)
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
incq %rcx
movq %rcx, 0x28(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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 0x15d39
testq %rax, %rax
je 0x15a6a
movq %r14, 0x10(%rax)
movq 0x28(%rbx), %rcx
testq %rcx, %rcx
je 0x15a6e
movq 0x8(%rbx), %rdx
movq %rdx, (%rax)
movq $0x0, 0x8(%rax)
movq %rax, 0x8(%rdx)
movq %rax, 0x8(%rbx)
jmp 0x15a7b
xorl %ebx, %ebx
jmp 0x15a82
movq %rax, 0x8(%rbx)
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
incq %rcx
movq %rcx, 0x28(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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 0x15d39
testq %rax, %rax
je 0x15acd
movq %r15, 0x10(%rax)
testl %ebp, %ebp
je 0x15ad1
movq %r14, (%rax)
movq 0x8(%r14), %rcx
movq %rcx, 0x8(%rax)
cmpq %r14, 0x8(%rbx)
jne 0x15ae6
leaq 0x8(%rbx), %rcx
jmp 0x15ae3
xorl %ebx, %ebx
jmp 0x15b02
movq %r14, 0x8(%rax)
movq (%r14), %rcx
movq %rcx, (%rax)
movq %rbx, %rcx
cmpq %r14, (%rbx)
jne 0x15ae6
movq %rax, (%rcx)
movq (%rax), %rcx
testq %rcx, %rcx
je 0x15af2
movq %rax, 0x8(%rcx)
movq 0x8(%rax), %rcx
testq %rcx, %rcx
je 0x15afe
movq %rax, (%rcx)
incq 0x28(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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
movq %rcx, (%rdx)
movq 0x8(%rsi), %rcx
leaq 0x8(%rdi), %rdx
testq %rcx, %rcx
cmovneq %rcx, %rdx
movq %rax, (%rdx)
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x15b50
movq 0x10(%r14), %rdi
callq *%rax
movq %r14, %rdi
callq 0x15e7b
decq 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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 0x15d39
testq %rax, %rax
je 0x15bfd
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
jmp 0x15bff
xorl %ebx, %ebx
testq %rbx, %rbx
je 0x15c62
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbx)
movq 0x18(%r14), %rax
movq %rax, 0x18(%rbx)
movq 0x20(%r14), %rax
movq %rax, 0x20(%rbx)
movq (%r14), %rcx
movq %rcx, %r14
testq %rcx, %rcx
je 0x15c2b
movq 0x8(%rcx), %r14
testq %rcx, %rcx
je 0x15c64
movq 0x10(%rbx), %rdx
movq 0x10(%rcx), %rax
testq %rdx, %rdx
je 0x15c47
movq %rax, %rdi
callq *%rdx
testq %rax, %rax
je 0x15c5a
movq %rbx, %rdi
movq %rax, %rsi
callq 0x15a2b
movq %r14, %rcx
testq %rax, %rax
jne 0x15c22
movq %rbx, %rdi
callq 0x1597c
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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 %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %r12
movq %r12, %r15
testq %r12, %r12
je 0x15c8c
movq 0x8(%r15), %r12
testq %r15, %r15
je 0x15cb0
movq 0x20(%r14), %rax
movq 0x10(%r15), %rdi
testq %rax, %rax
je 0x15ca9
movq %rbx, %rsi
callq *%rax
testl %eax, %eax
je 0x15c80
jmp 0x15cb3
cmpq %rbx, %rdi
jne 0x15c80
jmp 0x15cb3
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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 0x15cf1
movq (%rax), %rax
setne %cl
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x15d08
decq %rsi
movq 0x8(%rax), %rax
addq $-0x1, %rsi
jae 0x15d08
testq %rax, %rax
jne 0x15ce0
jmp 0x15d08
addq $0x8, %rax
incq %rsi
movq (%rax), %rax
testq %rsi, %rsi
je 0x15d08
incq %rsi
testq %rax, %rax
jne 0x15cf8
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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 0x15d31
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
nop
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/zmalloc.c
// Function: zmalloc
void *zmalloc(size_t size) {
    void *ptr = malloc(size+PREFIX_SIZE);

    if (!ptr) zmalloc_oom_handler(size);
#ifdef HAVE_MALLOC_SIZE
    update_zmalloc_stat_alloc(zmalloc_size(ptr));
    return ptr;
#else
    *((size_t*)ptr) = size;
    update_zmalloc_stat_alloc(size+PREFIX_SIZE);
    return (char*)ptr+PREFIX_SIZE;
#endif
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x1b3b8
movq %rax, %rbx
testq %rax, %rax
jne 0x15d56
movq %r14, %rdi
callq *0x365ca(%rip)          # 0x4c320
movq %rbx, %rdi
callq 0x202d4
addq $0x7, %rax
andq $-0x8, %rax
cmpb $0x1, 0x367a3(%rip)     # 0x4c510
jne 0x15d79
lock
addq %rax, 0x367a1(%rip)     # 0x4c518
jmp 0x15d80
addq %rax, 0x36798(%rip)     # 0x4c518
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/zmalloc.c
// Function: zcalloc
void *zcalloc(size_t size) {
    void *ptr = calloc(1, size+PREFIX_SIZE);

    if (!ptr) zmalloc_oom_handler(size);
#ifdef HAVE_MALLOC_SIZE
    update_zmalloc_stat_alloc(zmalloc_size(ptr));
    return ptr;
#else
    *((size_t*)ptr) = size;
    update_zmalloc_stat_alloc(size+PREFIX_SIZE);
    return (char*)ptr+PREFIX_SIZE;
#endif
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x1, %edi
movq %r14, %rsi
callq 0x1c07c
movq %rax, %rbx
testq %rax, %rax
jne 0x15db0
movq %r14, %rdi
callq *0x36570(%rip)          # 0x4c320
movq %rbx, %rdi
callq 0x202d4
addq $0x7, %rax
andq $-0x8, %rax
cmpb $0x1, 0x36749(%rip)     # 0x4c510
jne 0x15dd3
lock
addq %rax, 0x36747(%rip)     # 0x4c518
jmp 0x15dda
addq %rax, 0x3673e(%rip)     # 0x4c518
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/zmalloc.c
// Function: zrealloc
void *zrealloc(void *ptr, size_t size) {
#ifndef HAVE_MALLOC_SIZE
    void *realptr;
#endif
    size_t oldsize;
    void *newptr;

    if (ptr == NULL) return zmalloc(size);
#ifdef HAVE_MALLOC_SIZE
    oldsize = zmalloc_size(ptr);
    newptr = realloc(ptr,size);
    if (!newptr) zmalloc_oom_handler(size);

    update_zmalloc_stat_free(oldsize);
    update_zmalloc_stat_alloc(zmalloc_size(newptr));
    return newptr;
#else
    realptr = (char*)ptr-PREFIX_SIZE;
    oldsize = *((size_t*)realptr);
    newptr = realloc(realptr,size+PREFIX_SIZE);
    if (!newptr) zmalloc_oom_handler(size);

    *((size_t*)newptr) = size;
    update_zmalloc_stat_free(oldsize);
    update_zmalloc_stat_alloc(size);
    return (char*)newptr+PREFIX_SIZE;
#endif
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
testq %rdi, %rdi
je 0x15e34
movq %rdi, %rbx
callq 0x202d4
movq %rax, %r14
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1c88f
movq %rax, %rbx
testq %rax, %rax
jne 0x15e19
movq %r15, %rdi
callq *0x36507(%rip)          # 0x4c320
addq $0x7, %r14
andq $-0x8, %r14
cmpb $0x1, 0x366e8(%rip)     # 0x4c510
jne 0x15e41
lock
subq %r14, 0x366e6(%rip)     # 0x4c518
jmp 0x15e48
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x15d39
subq %r14, 0x366d0(%rip)     # 0x4c518
movq %rbx, %rdi
callq 0x202d4
addq $0x7, %rax
andq $-0x8, %rax
cmpb $0x1, 0x366b1(%rip)     # 0x4c510
jne 0x15e6b
lock
addq %rax, 0x366af(%rip)     # 0x4c518
jmp 0x15e72
addq %rax, 0x366a6(%rip)     # 0x4c518
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/zmalloc.c
// Function: zfree
void zfree(void *ptr) {
#ifndef HAVE_MALLOC_SIZE
    void *realptr;
    size_t oldsize;
#endif

    if (ptr == NULL) return;
#ifdef HAVE_MALLOC_SIZE
    update_zmalloc_stat_free(zmalloc_size(ptr));
    free(ptr);
#else
    realptr = (char*)ptr-PREFIX_SIZE;
    oldsize = *((size_t*)realptr);
    update_zmalloc_stat_free(oldsize+PREFIX_SIZE);
    free(realptr);
#endif
}

// Assembly:
testq %rdi, %rdi
je 0x15ea4
pushq %rbx
movq %rdi, %rbx
callq 0x202d4
addq $0x7, %rax
andq $-0x8, %rax
cmpb $0x1, 0x36678(%rip)     # 0x4c510
jne 0x15ea5
lock
subq %rax, 0x36676(%rip)     # 0x4c518
jmp 0x15eac
retq
subq %rax, 0x3666c(%rip)     # 0x4c518
movq %rbx, %rdi
popq %rbx
jmp 0x1d55f
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/zmalloc.c
// Function: zstrdup
char *zstrdup(const char *s) {
    size_t l = strlen(s)+1;
    char *p = zmalloc(l);

    memcpy(p,s,l);
    return p;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xb190
leaq 0x1(%rax), %r14
movq %r14, %rdi
callq 0x15d39
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xb340
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/zmalloc.c
// Function: zmalloc_get_rss
size_t zmalloc_get_rss(void) {
    int page = sysconf(_SC_PAGESIZE);
    size_t rss;
    char buf[4096];
    char filename[256];
    int fd, count;
    char *p, *x;

    snprintf(filename,256,"/proc/%d/stat",getpid());
    if ((fd = open(filename,O_RDONLY)) == -1) return 0;
    if (read(fd,buf,4096) <= 0) {
        close(fd);
        return 0;
    }
    close(fd);

    p = buf;
    count = 23; /* RSS is the 24th field in /proc/<pid>/stat */
    while(p && count--) {
        p = strchr(p,' ');
        if (p) p++;
    }
    if (!p) return 0;
    x = strchr(p,' ');
    if (!x) return 0;
    *x = '\0';

    rss = strtoll(p,NULL,10);
    rss *= page;
    return rss;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1108, %rsp           # imm = 0x1108
movl $0x1e, %edi
callq 0xb490
movq %rax, %rbx
callq 0xb160
leaq 0x24267(%rip), %rdx     # 0x3a193
xorl %r14d, %r14d
movq %rsp, %r15
movl $0x100, %esi            # imm = 0x100
movq %r15, %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0xb1d0
movq %r15, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0xb470
cmpl $-0x1, %eax
je 0x15fd8
movl %eax, %ebp
leaq 0x100(%rsp), %r15
movl $0x1000, %edx           # imm = 0x1000
movl %eax, %edi
movq %r15, %rsi
callq 0xb280
movq %rax, %r14
movl %ebp, %edi
callq 0xb240
testq %r14, %r14
jle 0x15fd5
movl $0xffffffe8, %ebp       # imm = 0xFFFFFFE8
xorl %r14d, %r14d
incl %ebp
je 0x15fa8
movq %r15, %rdi
movl $0x20, %esi
callq 0xb1b0
leaq 0x1(%rax), %r15
testq %rax, %rax
cmoveq %rax, %r15
jne 0x15f88
jmp 0x15fd8
movq %r15, %rdi
movl $0x20, %esi
callq 0xb1b0
testq %rax, %rax
je 0x15fd5
movb $0x0, (%rax)
movq %r15, %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0xb300
movslq %ebx, %r14
imulq %rax, %r14
jmp 0x15fd8
xorl %r14d, %r14d
movq %r14, %rax
addq $0x1108, %rsp           # imm = 0x1108
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/zmalloc.c
// Function: zmalloc_get_smap_bytes_by_field
size_t zmalloc_get_smap_bytes_by_field(char *field) {
    char line[1024];
    size_t bytes = 0;
    FILE *fp = fopen("/proc/self/smaps","r");
    int flen = strlen(field);

    if (!fp) return 0;
    while(fgets(line,sizeof(line),fp) != NULL) {
        if (strncmp(line,field,flen) == 0) {
            char *p = strchr(line,'k');
            if (p) {
                *p = '\0';
                bytes += strtol(line+flen,NULL,10) * 1024;
            }
        }
    }
    fclose(fp);
    return bytes;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdi, %r14
leaq 0x24143(%rip), %rdi     # 0x3a1a1
leaq 0x231ef(%rip), %rsi     # 0x39254
callq 0xb480
movq %rax, %rbx
movq %r14, %rdi
callq 0xb190
testq %rbx, %rbx
je 0x160f3
movq %rax, %r15
movq %rsp, %rdi
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdx
callq 0xb2b0
testq %rax, %rax
je 0x160f8
movslq %r15d, %r12
leaq (%rsp,%r12), %r13
xorl %r15d, %r15d
movq %rsp, %rbp
movq %rbp, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0xb0b0
testl %eax, %eax
jne 0x160dc
movq %rbp, %rdi
movl $0x6b, %esi
callq 0xb1b0
testq %rax, %rax
je 0x160dc
movb $0x0, (%rax)
movq %r13, %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0xb330
shlq $0xa, %rax
addq %rax, %r15
movq %rbp, %rdi
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdx
callq 0xb2b0
testq %rax, %rax
jne 0x1609f
jmp 0x160fb
xorl %r15d, %r15d
jmp 0x16103
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0xb180
movq %r15, %rax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/zmalloc.c
// Function: zmalloc_default_oom
static void zmalloc_default_oom(size_t size) {
    fprintf(stderr, "zmalloc: Out of memory trying to allocate %zu bytes\n",
        size);
    fflush(stderr);
    abort();
}

// Assembly:
pushq %rbx
movq %rdi, %rdx
movq 0x35ea3(%rip), %rbx     # 0x4bff0
movq (%rbx), %rdi
leaq 0x2406a(%rip), %rsi     # 0x3a1c1
xorl %eax, %eax
callq 0xb310
movq (%rbx), %rdi
callq 0xb3a0
callq 0xb070
nop
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/deps/hiredis/hiredis.c
// Function: redisReaderCreate
redisReader *redisReaderCreate(void) {
    redisReader *r;

    r = calloc(sizeof(redisReader),1);
    if (r == NULL)
        return NULL;

    r->err = 0;
    r->errstr[0] = '\0';
    r->fn = &defaultFunctions;
    r->buf = sdsempty();
    r->maxbuf = REDIS_READER_MAX_BUF;
    if (r->buf == NULL) {
        free(r);
        return NULL;
    }

    r->ridx = -1;
    return r;
}

// Assembly:
pushq %rbx
movl $0x230, %edi            # imm = 0x230
movl $0x1, %esi
callq 0xb2d0
testq %rax, %rax
je 0x16236
movq %rax, %rbx
movl $0x0, (%rax)
movb $0x0, 0x4(%rax)
leaq 0x36129(%rip), %rax     # 0x4c328
movq %rax, 0x220(%rbx)
callq 0x1846f
movq %rax, 0x88(%rbx)
movq $0x4000, 0xa0(%rbx) # imm = 0x4000
testq %rax, %rax
je 0x1622e
movl $0xffffffff, 0x210(%rbx) # imm = 0xFFFFFFFF
jmp 0x16238
movq %rbx, %rdi
callq 0xb050
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/deps/hiredis/hiredis.c
// Function: _redisSetError
void __redisSetError(redisContext *c, int type, const char *str) {
    size_t len;

    c->err = type;
    if (str != NULL) {
        len = strlen(str);
        len = len < (sizeof(c->errstr)-1) ? len : (sizeof(c->errstr)-1);
        memcpy(c->errstr,str,len);
        c->errstr[len] = '\0';
    } else {
        /* Only REDIS_ERR_IO may lack a description! */
        assert(type == REDIS_ERR_IO);
        strerror_r(errno,c->errstr,sizeof(c->errstr));
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl %esi, (%rdi)
testq %rdx, %rdx
je 0x17467
movq %rdx, %r14
movq %rdx, %rdi
callq 0xb190
cmpq $0x7f, %rax
movl $0x7f, %r15d
cmovbq %rax, %r15
leaq 0x4(%rbx), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xb340
movb $0x0, 0x4(%rbx,%r15)
popq %rbx
popq %r14
popq %r15
retq
cmpl $0x1, %esi
jne 0x17489
callq 0xb080
movl (%rax), %edi
addq $0x4, %rbx
movl $0x80, %edx
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xb110
leaq 0x22fbe(%rip), %rdi     # 0x3a44e
leaq 0x22ebf(%rip), %rsi     # 0x3a356
leaq 0x22fc5(%rip), %rcx     # 0x3a463
movl $0x3d8, %edx            # imm = 0x3D8
callq 0xb210
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/deps/hiredis/hiredis.c
// Function: redisFree
void redisFree(redisContext *c) {
    if (c->fd > 0)
        close(c->fd);
    if (c->obuf != NULL)
        sdsfree(c->obuf);
    if (c->reader != NULL)
        redisReaderFree(c->reader);
    free(c);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x84(%rdi), %edi
testl %edi, %edi
jle 0x174bb
callq 0xb240
movq 0x90(%rbx), %rdi
testq %rdi, %rdi
je 0x174cc
callq 0x18503
movq 0x98(%rbx), %rdi
testq %rdi, %rdi
je 0x174dd
callq 0x1623d
movq %rbx, %rdi
popq %rbx
jmp 0xb050
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/deps/hiredis/hiredis.c
// Function: redisFreeKeepFd
int redisFreeKeepFd(redisContext *c) {
	int fd = c->fd;
	c->fd = -1;
	redisFree(c);
	return fd;
}

// Assembly:
pushq %rbx
movl 0x84(%rdi), %ebx
movl $0xffffffff, 0x84(%rdi) # imm = 0xFFFFFFFF
callq 0x174a8
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/deps/hiredis/hiredis.c
// Function: redisContextInit
static redisContext *redisContextInit(void) {
    redisContext *c;

    c = calloc(1,sizeof(redisContext));
    if (c == NULL)
        return NULL;

    c->err = 0;
    c->errstr[0] = '\0';
    c->obuf = sdsempty();
    c->reader = redisReaderCreate();
    return c;
}

// Assembly:
pushq %rbx
movl $0x1, %edi
movl $0xa0, %esi
callq 0xb2d0
testq %rax, %rax
je 0x17574
movq %rax, %rbx
movl $0x0, (%rax)
movb $0x0, 0x4(%rax)
callq 0x1846f
movq %rax, 0x90(%rbx)
callq 0x161d6
movq %rax, 0x98(%rbx)
jmp 0x17576
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/deps/hiredis/hiredis.c
// Function: redisvAppendCommand
int redisvAppendCommand(redisContext *c, const char *format, va_list ap) {
    char *cmd;
    int len;

    len = redisvFormatCommand(&cmd,format,ap);
    if (len == -1) {
        __redisSetError(c,REDIS_ERR_OOM,"Out of memory");
        return REDIS_ERR;
    }

    if (__redisAppendCommand(c,cmd,len) != REDIS_OK) {
        free(cmd);
        return REDIS_ERR;
    }

    free(cmd);
    return REDIS_OK;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %rdi
callq 0x169e2
cmpl $-0x1, %eax
je 0x17bef
movq (%rsp), %rsi
movslq %eax, %rdx
movq 0x90(%rbx), %rdi
callq 0x18c9d
movq %rax, %r14
testq %rax, %rax
je 0x17c1c
movq %r14, 0x90(%rbx)
jmp 0x17c42
movl $0x5, (%rbx)
movabsq $0x6d20666f2074754f, %rax # imm = 0x6D20666F2074754F
movq %rax, 0x4(%rbx)
movabsq $0x79726f6d656d2066, %rax # imm = 0x79726F6D656D2066
movq %rax, 0x9(%rbx)
movb $0x0, 0x11(%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x17c53
movl $0x5, (%rbx)
movabsq $0x6d20666f2074754f, %rax # imm = 0x6D20666F2074754F
movq %rax, 0x4(%rbx)
movabsq $0x79726f6d656d2066, %rax # imm = 0x79726F6D656D2066
movq %rax, 0x9(%rbx)
movb $0x0, 0x11(%rbx)
movq (%rsp), %rdi
callq 0xb050
xorl %eax, %eax
cmpq $0x1, %r14
sbbl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/deps/hiredis/hiredis.c
// Function: redisAppendCommandArgv
int redisAppendCommandArgv(redisContext *c, int argc, const char **argv, const size_t *argvlen) {
    char *cmd;
    int len;

    len = redisFormatCommandArgv(&cmd,argc,argv,argvlen);
    if (len == -1) {
        __redisSetError(c,REDIS_ERR_OOM,"Out of memory");
        return REDIS_ERR;
    }

    if (__redisAppendCommand(c,cmd,len) != REDIS_OK) {
        free(cmd);
        return REDIS_ERR;
    }

    free(cmd);
    return REDIS_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x17287
cmpl $-0x1, %eax
je 0x17d22
movq 0x8(%rsp), %r14
movslq %eax, %rdx
movq 0x90(%rbx), %rdi
movq %r14, %rsi
callq 0x18c9d
movq %rax, %r15
testq %rax, %rax
je 0x17d4f
movq %r15, 0x90(%rbx)
jmp 0x17d75
movl $0x5, (%rbx)
movabsq $0x6d20666f2074754f, %rax # imm = 0x6D20666F2074754F
movq %rax, 0x4(%rbx)
movabsq $0x79726f6d656d2066, %rax # imm = 0x79726F6D656D2066
movq %rax, 0x9(%rbx)
movb $0x0, 0x11(%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x17d85
movl $0x5, (%rbx)
movabsq $0x6d20666f2074754f, %rax # imm = 0x6D20666F2074754F
movq %rax, 0x4(%rbx)
movabsq $0x79726f6d656d2066, %rax # imm = 0x79726F6D656D2066
movq %rax, 0x9(%rbx)
movb $0x0, 0x11(%rbx)
movq %r14, %rdi
callq 0xb050
xorl %eax, %eax
cmpq $0x1, %r15
sbbl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/deps/hiredis/sds.c
// Function: sdsnewlen
sds sdsnewlen(const void *init, size_t initlen) {
    void *sh;
    sds s;
    char type = sdsReqType(initlen);
    /* Empty strings are usually created in order to append. Use type 8
     * since type 5 is not good at this. */
    if (type == SDS_TYPE_5 && initlen == 0) type = SDS_TYPE_8;
    int hdrlen = sdsHdrSize(type);
    unsigned char *fp; /* flags pointer. */

    sh = s_malloc(hdrlen+initlen+1);
    if (!init)
        memset(sh, 0, hdrlen+initlen+1);
    if (sh == NULL) return NULL;
    s = (char*)sh+hdrlen;
    fp = ((unsigned char*)s)-1;
    switch(type) {
        case SDS_TYPE_5: {
            *fp = type | (initlen << SDS_TYPE_BITS);
            break;
        }
        case SDS_TYPE_8: {
            SDS_HDR_VAR(8,s);
            sh->len = initlen;
            sh->alloc = initlen;
            *fp = type;
            break;
        }
        case SDS_TYPE_16: {
            SDS_HDR_VAR(16,s);
            sh->len = initlen;
            sh->alloc = initlen;
            *fp = type;
            break;
        }
        case SDS_TYPE_32: {
            SDS_HDR_VAR(32,s);
            sh->len = initlen;
            sh->alloc = initlen;
            *fp = type;
            break;
        }
        case SDS_TYPE_64: {
            SDS_HDR_VAR(64,s);
            sh->len = initlen;
            sh->alloc = initlen;
            *fp = type;
            break;
        }
    }
    if (initlen && init)
        memcpy(s, init, initlen);
    s[initlen] = '\0';
    return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
cmpq $0x20, %rsi
movq %rdi, (%rsp)
jae 0x18378
xorl %eax, %eax
jmp 0x1839a
movb $0x1, %al
cmpq $0xff, %rbx
jb 0x1839a
movb $0x2, %al
cmpq $0xffff, %rbx           # imm = 0xFFFF
jb 0x1839a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %rbx
movb $0x4, %al
sbbb $0x0, %al
testb %al, %al
movzbl %al, %eax
movl $0x1, %ebp
cmovnel %eax, %ebp
testq %rbx, %rbx
cmovnel %eax, %ebp
movzbl %bpl, %r13d
leaq 0x22720(%rip), %rax     # 0x3aad8
movq (%rax,%r13,8), %r14
leaq (%rbx,%r14), %r12
incq %r12
movq %r12, %rdi
callq 0xb390
movq %rax, %r15
movq (%rsp), %rsi
testq %rsi, %rsi
jne 0x183e8
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0xb230
movq (%rsp), %rsi
testq %r15, %r15
je 0x1840c
addq %r14, %r15
leaq 0x22341(%rip), %rax     # 0x3a738
movslq (%rax,%r13,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leal (,%rbx,8), %eax
orb %al, %bpl
jmp 0x18439
xorl %r15d, %r15d
jmp 0x1845d
movq %rbx, -0x11(%r15)
movq %rbx, -0x9(%r15)
jmp 0x18439
movw %bx, -0x5(%r15)
movw %bx, -0x3(%r15)
jmp 0x18439
movl %ebx, -0x9(%r15)
movl %ebx, -0x5(%r15)
jmp 0x18439
movb %bl, -0x3(%r15)
movb %bl, -0x2(%r15)
testq %rsi, %rsi
sete %al
movb %bpl, -0x1(%r15)
testq %rbx, %rbx
sete %cl
orb %al, %cl
jne 0x18458
movq %r15, %rdi
movq %rbx, %rdx
callq 0xb340
movb $0x0, (%r15,%rbx)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/deps/hiredis/./sds.h
// Function: sdsdup
static inline size_t sdslen(const sds s) {
    unsigned char flags = s[-1];
    switch(flags&SDS_TYPE_MASK) {
        case SDS_TYPE_5:
            return SDS_TYPE_5_LEN(flags);
        case SDS_TYPE_8:
            return SDS_HDR(8,s)->len;
        case SDS_TYPE_16:
            return SDS_HDR(16,s)->len;
        case SDS_TYPE_32:
            return SDS_HDR(32,s)->len;
        case SDS_TYPE_64:
            return SDS_HDR(64,s)->len;
    }
    return 0;
}

// Assembly:
movzbl -0x1(%rdi), %esi
movl %esi, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x184fc
leaq 0x22284(%rip), %rcx     # 0x3a74c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %esi
jmp 0x1835c
movq -0x11(%rdi), %rsi
jmp 0x1835c
movzwl -0x5(%rdi), %esi
jmp 0x1835c
movl -0x9(%rdi), %esi
jmp 0x1835c
movzbl -0x3(%rdi), %esi
jmp 0x1835c
xorl %esi, %esi
jmp 0x1835c