LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/token.c
// Function: read_file
int read_file(char *filename)
{
    FILE *fp;
    char *line, *token;

	line = malloc(STR_MAX);
	token = malloc(STR_MAX);

	memset(line, 0, STR_MAX);
	memset(token, 0, STR_MAX);

    printf("Open Filename: %s\n",filename);
    if((fp =fopen(filename,"rb")) == NULL){
        printf("can't open file.\n");
		free(line);
		free(token);
        exit(1);
    }
    while(1){
        get_line(line, fp);
        get_token(line, token);
        if(*token == '\0') break;
        insert_token_order(line, token, fp);    // トークンを追加する
    }
    fclose(fp);

	free(line);
	free(token);

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r15
pushq $0x1
popq %r14
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdi
callq 0x10f0
movq %rax, %rbx
movl $0x400, %esi            # imm = 0x400
movq %r14, %rdi
callq 0x10f0
movq %rax, %r14
leaq 0x2e22(%rip), %rdi      # 0xf23e
movq %r15, %rsi
xorl %eax, %eax
callq 0x10b0
leaq 0x2c3c(%rip), %rsi      # 0xf069
movq %r15, %rdi
callq 0x1160
testq %rax, %rax
je 0xc489
movq %rax, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0xbdde
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbe02
cmpb $0x0, (%r14)
je 0xc469
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xc22f
jmp 0xc43d
movq %r15, %rdi
callq 0x1080
movq %rbx, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x2c9b(%rip), %rdi      # 0xf12b
callq 0x1070
movq %rbx, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
pushq $0x1
popq %rdi
callq 0x11b0
// File: /workspace/github_c_makefile_star2_O2/aquaxis[P]synverll/src/token.c
// Function: get_chara_llvm
int get_chara_llvm(char *line, char *token)
{
    char *p, *ptk, *pp;

    // ポインタの初期化
    p   = line;
    ptk = token;

    *ptk = 0;

    // cか"の場合、読み飛ばす
    while(*p == 'c' || *p == '"') ++p;
    // バッファが空の場合は終了する
    if(*p == '\0'){
		pp = malloc(strlen(p)+1);	// 残りの文字列をlineに戻す
		strcpy(pp,p);
		strcpy(line,pp);
		free(pp);
        token[0] = '\0';
        return 1;
    }

    if(*p == '"'){
		// "は終了
		*ptk = 0;
		return -1;
    }else if(*p == '\\'){
        (*p)++;
		// \はこの後に2文字16進数が続く
		/*
		 * ToDo:
		 *   isxdigit(*p)でエラー処理を入れる
		 */
        *ptk = *p++;
		*ptk <<= 4;	// 16倍する
        *ptk = *p++;
    }else{	// それ以外は一文字のキャラクターとして処理する
        *ptk = *p++;
	}
    pp = malloc(strlen(p)+1);	// 残りの文字列をlineに戻す
    strcpy(pp,p);
    strcpy(line,pp);
    free(pp);
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movb $0x0, (%rsi)
movq %rdi, %r15
movzbl (%r15), %eax
cmpl $0x22, %eax
je 0xca54
cmpl $0x63, %eax
jne 0xca59
incq %r15
jmp 0xca46
testl %eax, %eax
je 0xca74
cmpl $0x5c, %eax
jne 0xcaaf
movb $0x5d, (%r15)
movb $-0x30, (%r14)
movb 0x1(%r15), %al
addq $0x2, %r15
jmp 0xcab2
movq %r15, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
callq 0x1130
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x1060
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1060
movq %r12, %rdi
callq 0x1030
movb $0x0, (%r14)
pushq $0x1
popq %rax
jmp 0xcae9
incq %r15
movb %al, (%r14)
movq %r15, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
callq 0x1130
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x1060
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1060
movq %r14, %rdi
callq 0x1030
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/net.c
// Function: redisKeepAlive
int redisKeepAlive(redisContext *c, int interval) {
    int val = 1;
    int fd = c->fd;

    if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &val, sizeof(val)) == -1){
        __redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
        return REDIS_ERR;
    }

    val = interval;

#ifdef _OSX
    if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPALIVE, &val, sizeof(val)) < 0) {
        __redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
        return REDIS_ERR;
    }
#else
#if defined(__GLIBC__) && !defined(__FreeBSD_kernel__)
    val = interval;
    if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &val, sizeof(val)) < 0) {
        __redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
        return REDIS_ERR;
    }

    val = interval/3;
    if (val == 0) val = 1;
    if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, &val, sizeof(val)) < 0) {
        __redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
        return REDIS_ERR;
    }

    val = 3;
    if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &val, sizeof(val)) < 0) {
        __redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
        return REDIS_ERR;
    }
#endif
#endif

    return REDIS_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x4(%rsp), %rcx
movl $0x1, (%rcx)
movl 0x84(%rdi), %ebp
pushq $0x1
popq %r15
pushq $0x9
popq %rdx
pushq $0x4
popq %r8
movl %ebp, %edi
movl %r15d, %esi
callq 0x30e0
cmpl $-0x1, %eax
je 0x36f4
leaq 0x4(%rsp), %rcx
movl %r14d, (%rcx)
pushq $0x6
popq %rsi
pushq $0x4
popq %rdx
movl %ebp, %edi
movl %edx, %r8d
callq 0x30e0
testl %eax, %eax
js 0x36f4
pushq $0x3
popq %rcx
movl %r14d, %eax
cltd
idivl %ecx
addl $0x2, %r14d
cmpl $0x5, %r14d
cmovbl %r15d, %eax
leaq 0x4(%rsp), %rcx
movl %eax, (%rcx)
pushq $0x6
popq %rsi
pushq $0x5
popq %rdx
pushq $0x4
popq %r8
movl %ebp, %edi
callq 0x30e0
testl %eax, %eax
js 0x36f4
leaq 0x4(%rsp), %rcx
movl $0x3, (%rcx)
pushq $0x6
popq %rdx
pushq $0x4
popq %r8
movl %ebp, %edi
movl %edx, %esi
callq 0x30e0
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jns 0x3711
callq 0x3080
movl (%rax), %edi
callq 0x34e0
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x32b0
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/net.c
// Function: redisCheckSocketError
int redisCheckSocketError(redisContext *c) {
    int err = 0;
    socklen_t errlen = sizeof(err);

    if (getsockopt(c->fd, SOL_SOCKET, SO_ERROR, &err, &errlen) == -1) {
        __redisSetErrorFromErrno(c,REDIS_ERR_IO,"getsockopt(SO_ERROR)");
        return REDIS_ERR;
    }

    if (err) {
        errno = err;
        __redisSetErrorFromErrno(c,REDIS_ERR_IO,NULL);
        return REDIS_ERR;
    }

    return REDIS_OK;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsp, %rcx
andl $0x0, (%rcx)
movq %rdi, %rbx
leaq 0x4(%rsp), %r8
movl $0x4, (%r8)
movl 0x84(%rdi), %edi
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
callq 0x3280
cmpl $-0x1, %eax
je 0x375f
movl (%rsp), %ebp
testl %ebp, %ebp
je 0x3773
callq 0x3080
movl %ebp, (%rax)
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x3769
leaq 0x589a(%rip), %rsi      # 0x9000
movq %rbx, %rdi
callq 0x377c
pushq $-0x1
popq %rax
jmp 0x3775
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/net.c
// Function: _redisSetErrorFromErrno
static void __redisSetErrorFromErrno(redisContext *c, int type, const char *prefix) {
    char buf[128] = { 0 };
    size_t len = 0;

    if (prefix != NULL)
        len = snprintf(buf,sizeof(buf),"%s: ",prefix);
    __redis_strerror_r(errno, (char *)(buf + len), sizeof(buf) - len);
    __redisSetError(c,type,buf);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
testq %rsi, %rsi
je 0x37d6
movq %rsi, %rcx
leaq 0x5883(%rip), %rdx      # 0x9045
movq %rsp, %rdi
movl $0x80, %esi
xorl %eax, %eax
callq 0x3190
movslq %eax, %r14
jmp 0x37d9
xorl %r14d, %r14d
callq 0x3080
movl (%rax), %edi
leaq (%rsp,%r14), %rsi
movl $0x80, %edx
subq %r14, %rdx
callq 0x3100
pushq $0x1
popq %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x32b0
addq $0x88, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/net.c
// Function: redisContextConnectUnix
int redisContextConnectUnix(redisContext *c, const char *path, const struct timeval *timeout) {
    int blocking = (c->flags & REDIS_BLOCK);
    struct sockaddr_un sa;

    if (redisCreateSocket(c,AF_LOCAL) < 0)
        return REDIS_ERR;
    if (redisSetBlocking(c,0) != REDIS_OK)
        return REDIS_ERR;

    c->connection_type = REDIS_CONN_UNIX;
    if (c->unix_sock.path != path)
        c->unix_sock.path = strdup(path);

    if (timeout) {
        if (c->timeout != timeout) {
            if (c->timeout == NULL)
                c->timeout = malloc(sizeof(struct timeval));

            memcpy(c->timeout, timeout, sizeof(struct timeval));
        }
    } else {
        if (c->timeout)
            free(c->timeout);
        c->timeout = NULL;
    }

    sa.sun_family = AF_LOCAL;
    strncpy(sa.sun_path,path,sizeof(sa.sun_path)-1);
    if (connect(c->fd, (struct sockaddr*)&sa, sizeof(sa)) == -1) {
        if (errno == EINPROGRESS && !blocking) {
            /* This is ok. */
        } else {
            if (redisContextWaitReady(c,c->timeout) != REDIS_OK)
                return REDIS_ERR;
        }
    }

    /* Reset socket to be blocking after connect(2). */
    if (blocking && redisSetBlocking(c,1) != REDIS_OK)
        return REDIS_ERR;

    c->flags |= REDIS_CONNECTED;
    return REDIS_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movl 0x88(%rdi), %r12d
pushq $0x1
popq %rdi
movl %edi, %esi
xorl %edx, %edx
callq 0x3560
cmpl $-0x1, %eax
je 0x3cdd
movl %eax, 0x84(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3d82
pushq $-0x1
popq %rbp
testl %eax, %eax
jne 0x3d73
movl $0x1, 0xa0(%rbx)
cmpq %r14, 0xc8(%rbx)
je 0x3cac
movq %r14, %rdi
callq 0x34d0
movq %rax, 0xc8(%rbx)
movq 0xa8(%rbx), %rdi
testq %r15, %r15
je 0x3cef
cmpq %r15, %rdi
je 0x3cfc
testq %rdi, %rdi
jne 0x3cd4
pushq $0x10
popq %rdi
callq 0x3350
movq %rax, %rdi
movq %rax, 0xa8(%rbx)
movups (%r15), %xmm0
movups %xmm0, (%rdi)
jmp 0x3cfc
movq %rbx, %rdi
xorl %esi, %esi
callq 0x377c
pushq $-0x1
popq %rbp
jmp 0x3d73
callq 0x3050
andq $0x0, 0xa8(%rbx)
leaq 0x4(%rsp), %rdi
movw $0x1, -0x2(%rdi)
pushq $0x6b
popq %rdx
movq %r14, %rsi
callq 0x3090
movl 0x84(%rbx), %edi
leaq 0x2(%rsp), %rsi
pushq $0x6e
popq %rdx
callq 0x3480
cmpl $-0x1, %eax
je 0x3d41
testb $0x1, %r12b
je 0x3d6a
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x3d82
testl %eax, %eax
jne 0x3d73
jmp 0x3d6a
callq 0x3080
movl (%rax), %eax
xorl $0x73, %eax
movl %r12d, %ecx
andl $0x1, %ecx
orl %eax, %ecx
je 0x3d6a
movq 0xa8(%rbx), %rsi
movq %rbx, %rdi
callq 0x3df4
testl %eax, %eax
jne 0x3d73
jmp 0x3d2a
orb $0x2, 0x88(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/net.c
// Function: redisSetBlocking
static int redisSetBlocking(redisContext *c, int blocking) {
    int flags;

    /* Set the socket nonblocking.
     * Note that fcntl(2) for F_GETFL and F_SETFL can't be
     * interrupted by a signal. */
    if ((flags = fcntl(c->fd, F_GETFL)) == -1) {
        __redisSetErrorFromErrno(c,REDIS_ERR_IO,"fcntl(F_GETFL)");
        redisContextCloseFd(c);
        return REDIS_ERR;
    }

    if (blocking)
        flags &= ~O_NONBLOCK;
    else
        flags |= O_NONBLOCK;

    if (fcntl(c->fd, F_SETFL, flags) == -1) {
        __redisSetErrorFromErrno(c,REDIS_ERR_IO,"fcntl(F_SETFL)");
        redisContextCloseFd(c);
        return REDIS_ERR;
    }
    return REDIS_OK;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
movl 0x84(%rdi), %edi
xorl %ebp, %ebp
pushq $0x3
popq %rsi
xorl %eax, %eax
callq 0x3110
cmpl $-0x1, %eax
je 0x3dd3
xorl %edx, %edx
testl %r14d, %r14d
sete %dl
andl $0xfffff7ff, %eax       # imm = 0xFFFFF7FF
shll $0xb, %edx
orl %eax, %edx
movl 0x84(%rbx), %edi
pushq $0x4
popq %rsi
xorl %eax, %eax
callq 0x3110
cmpl $-0x1, %eax
jne 0x3ded
leaq 0x52e4(%rip), %rsi      # 0x90b5
jmp 0x3dda
leaq 0x52cc(%rip), %rsi      # 0x90a6
movq %rbx, %rdi
callq 0x377c
movq %rbx, %rdi
callq 0x3ecd
pushq $-0x1
popq %rbp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/net.c
// Function: redisContextWaitReady
static int redisContextWaitReady(redisContext *c, const struct timeval *timeout) {
    struct pollfd   wfd[1];
    long msec;

    msec          = -1;
    wfd[0].fd     = c->fd;
    wfd[0].events = POLLOUT;

    /* Only use timeout when not NULL. */
    if (timeout != NULL) {
        if (timeout->tv_usec > 1000000 || timeout->tv_sec > __MAX_MSEC) {
            __redisSetErrorFromErrno(c, REDIS_ERR_IO, NULL);
            redisContextCloseFd(c);
            return REDIS_ERR;
        }

        msec = (timeout->tv_sec * 1000) + ((timeout->tv_usec + 999) / 1000);

        if (msec < 0 || msec > INT_MAX) {
            msec = INT_MAX;
        }
    }

    if (errno == EINPROGRESS) {
        int res;

        if ((res = poll(wfd, 1, msec)) == -1) {
            __redisSetErrorFromErrno(c, REDIS_ERR_IO, "poll(2)");
            redisContextCloseFd(c);
            return REDIS_ERR;
        } else if (res == 0) {
            errno = ETIMEDOUT;
            __redisSetErrorFromErrno(c,REDIS_ERR_IO,NULL);
            redisContextCloseFd(c);
            return REDIS_ERR;
        }

        if (redisCheckSocketError(c) != REDIS_OK)
            return REDIS_ERR;

        return REDIS_OK;
    }

    __redisSetErrorFromErrno(c,REDIS_ERR_IO,NULL);
    redisContextCloseFd(c);
    return REDIS_ERR;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl 0x84(%rdi), %eax
movl %eax, 0x8(%rsp)
movw $0x4, 0xc(%rsp)
testq %rsi, %rsi
je 0x3e5f
movq 0x8(%rsi), %rax
cmpq $0xf4240, %rax          # imm = 0xF4240
jg 0x3e9c
movq (%rsi), %rcx
movabsq $0x20c49ba5e353f7, %rdx # imm = 0x20C49BA5E353F7
cmpq %rdx, %rcx
jge 0x3e9c
imulq $0x3e8, %rcx, %rcx      # imm = 0x3E8
addq $0x3e7, %rax            # imm = 0x3E7
movl $0x3e8, %esi            # imm = 0x3E8
cqto
idivq %rsi
movq %rax, %r14
addq %rcx, %r14
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpq %rax, %r14
cmovaeq %rax, %r14
jmp 0x3e63
pushq $-0x1
popq %r14
callq 0x3080
cmpl $0x73, (%rax)
jne 0x3e9c
movq %rax, %r15
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
movl %r14d, %edx
callq 0x33e0
testl %eax, %eax
je 0x3e95
cmpl $-0x1, %eax
jne 0x3ebb
leaq 0x5234(%rip), %rsi      # 0x90c4
movq %rbx, %rdi
jmp 0x3ea1
movl $0x6e, (%r15)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x377c
movq %rbx, %rdi
callq 0x3ecd
pushq $-0x1
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0x3160
movl %eax, %ecx
xorl %eax, %eax
negl %ecx
sbbl %eax, %eax
jmp 0x3eb1
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: freeReplyObject
void freeReplyObject(void *reply) {
    redisReply *r = reply;
    size_t j;

    if (r == NULL)
        return;

    switch(r->type) {
    case REDIS_REPLY_INTEGER:
        break; /* Nothing to free */
    case REDIS_REPLY_ARRAY:
        if (r->element != NULL) {
            for (j = 0; j < r->elements; j++)
                if (r->element[j] != NULL)
                    freeReplyObject(r->element[j]);
            free(r->element);
        }
        break;
    case REDIS_REPLY_ERROR:
    case REDIS_REPLY_STATUS:
    case REDIS_REPLY_STRING:
        if (r->str != NULL)
            free(r->str);
        break;
    }
    free(r);
}

// Assembly:
testq %rdi, %rdi
je 0x3f4f
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %eax
leal -0x5(%rax), %ecx
cmpl $0x2, %ecx
jb 0x3f37
cmpl $0x1, %eax
je 0x3f37
cmpl $0x2, %eax
jne 0x3f40
cmpq $0x0, 0x28(%rbx)
je 0x3f40
xorl %r14d, %r14d
movq 0x28(%rbx), %rdi
cmpq 0x20(%rbx), %r14
jae 0x3f3b
movq (%rdi,%r14,8), %rdi
testq %rdi, %rdi
je 0x3f32
callq 0x3400
incq %r14
jmp 0x3f1a
movq 0x18(%rbx), %rdi
callq 0x3050
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3050
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: countDigits
static uint32_t countDigits(uint64_t v) {
  uint32_t result = 1;
  for (;;) {
    if (v < 10) return result;
    if (v < 100) return result + 1;
    if (v < 1000) return result + 2;
    if (v < 10000) return result + 3;
    v /= 10000U;
    result += 4;
  }
}

// Assembly:
movq %rdi, %rax
pushq $0x4
popq %rcx
movl $0x2710, %esi           # imm = 0x2710
cmpq $0xa, %rax
jb 0x4560
cmpq $0x63, %rax
jbe 0x4565
cmpq $0x3e7, %rax            # imm = 0x3E7
jbe 0x456a
cmpq $0x2710, %rax           # imm = 0x2710
jb 0x456c
xorl %edx, %edx
divq %rsi
addl $0x4, %ecx
jmp 0x453a
addl $-0x3, %ecx
jmp 0x456c
addl $-0x2, %ecx
jmp 0x456c
decl %ecx
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: redisFormatCommand
int redisFormatCommand(char **target, const char *format, ...) {
    va_list ap;
    int len;
    va_start(ap,format);
    len = redisvFormatCommand(target,format,ap);
    va_end(ap);

    /* The API says "-1" means bad result, but we now also return "-2" in some
     * cases.  Force the return value to always be -1. */
    if (len < 0)
        len = -1;

    return len;
}

// Assembly:
subq $0xd8, %rsp
leaq 0x20(%rsp), %r10
movq %rdx, 0x10(%r10)
movq %rcx, 0x18(%r10)
movq %r8, 0x20(%r10)
movq %r9, 0x28(%r10)
testb %al, %al
je 0x45c6
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rdx
movq %r10, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
callq 0x3500
testl %eax, %eax
pushq $-0x1
popq %rcx
cmovsl %ecx, %eax
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: redisFormatSdsCommandArgv
int redisFormatSdsCommandArgv(sds *target, int argc, const char **argv,
                              const size_t *argvlen)
{
    sds cmd;
    unsigned long long totlen;
    int j;
    size_t len;

    /* Abort on a NULL target */
    if (target == NULL)
        return -1;

    /* Calculate our total size */
    totlen = 1+countDigits(argc)+2;
    for (j = 0; j < argc; j++) {
        len = argvlen ? argvlen[j] : strlen(argv[j]);
        totlen += bulklen(len);
    }

    /* Use an SDS string for command construction */
    cmd = sdsempty();
    if (cmd == NULL)
        return -1;

    /* We already know how much storage we need */
    cmd = sdsMakeRoomFor(cmd, totlen);
    if (cmd == NULL)
        return -1;

    /* Construct command */
    cmd = sdscatfmt(cmd, "*%i\r\n", argc);
    for (j=0; j < argc; j++) {
        len = argvlen ? argvlen[j] : strlen(argv[j]);
        cmd = sdscatfmt(cmd, "$%T\r\n", len);
        cmd = sdscatlen(cmd, argv[j], len);
        cmd = sdscatlen(cmd, "\r\n", sizeof("\r\n")-1);
    }

    assert(sdslen(cmd)==totlen);

    *target = cmd;
    return totlen;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
pushq $-0x1
popq %r13
testq %rdi, %rdi
je 0x472a
movq %rcx, %r14
movl %esi, %ebp
movq %rdx, (%rsp)
movq %rdi, 0x8(%rsp)
movslq %esi, %rbx
movq %rbx, %rdi
callq 0x452f
movl %eax, %r12d
addl $0x3, %r12d
xorl %r15d, %r15d
testl %ebx, %ebx
movl $0x0, %ebx
cmovgl %ebp, %ebx
cmpq %r15, %rbx
je 0x4670
testq %r14, %r14
je 0x4653
movq (%r14,%r15,8), %rdi
jmp 0x4663
movq (%rsp), %rax
movq (%rax,%r15,8), %rdi
callq 0x3140
movq %rax, %rdi
callq 0x451a
addq %rax, %r12
incq %r15
jmp 0x4643
callq 0x34a0
testq %rax, %rax
je 0x472a
movq %rax, %rdi
movq %r12, %rsi
callq 0x31d0
testq %rax, %rax
je 0x472a
leaq 0x4aaa(%rip), %rsi      # 0x9143
movq %rax, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x3520
movq %rax, %r13
xorl %r15d, %r15d
movq %rbx, 0x10(%rsp)
cmpq %r15, %rbx
je 0x4716
testq %r14, %r14
je 0x46c4
movq (%r14,%r15,8), %rbp
movq (%rsp), %rbx
jmp 0x46d4
movq (%rsp), %rbx
movq (%rbx,%r15,8), %rdi
callq 0x3140
movq %rax, %rbp
movq %r13, %rdi
leaq 0x4a6b(%rip), %rsi      # 0x9149
movq %rbp, %rdx
xorl %eax, %eax
callq 0x3520
movq (%rbx,%r15,8), %rsi
movq %rax, %rdi
movq %rbp, %rdx
callq 0x3430
movq %rax, %rdi
leaq 0x4a4b(%rip), %rsi      # 0x914c
pushq $0x2
popq %rdx
callq 0x3430
movq %rax, %r13
incq %r15
movq 0x10(%rsp), %rbx
jmp 0x46b0
movslq -0x8(%r13), %rax
cmpq %rax, %r12
jne 0x473c
movq 0x8(%rsp), %rax
movq %r13, (%rax)
movl %r12d, %r13d
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4a0c(%rip), %rdi      # 0x914f
leaq 0x49a8(%rip), %rsi      # 0x90f2
leaq 0x4a12(%rip), %rcx      # 0x9163
movl $0x203, %edx            # imm = 0x203
callq 0x31c0
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: redisFormatCommandArgv
int redisFormatCommandArgv(char **target, int argc, const char **argv, const size_t *argvlen) {
    char *cmd = NULL; /* final command */
    int pos; /* position in final command */
    size_t len;
    int totlen, j;

    /* Abort on a NULL target */
    if (target == NULL)
        return -1;

    /* Calculate number of bytes needed for the command */
    totlen = 1+countDigits(argc)+2;
    for (j = 0; j < argc; j++) {
        len = argvlen ? argvlen[j] : strlen(argv[j]);
        totlen += bulklen(len);
    }

    /* Build the command at protocol level */
    cmd = malloc(totlen+1);
    if (cmd == NULL)
        return -1;

    pos = sprintf(cmd,"*%d\r\n",argc);
    for (j = 0; j < argc; j++) {
        len = argvlen ? argvlen[j] : strlen(argv[j]);
        pos += sprintf(cmd+pos,"$%zu\r\n",len);
        memcpy(cmd+pos,argv[j],len);
        pos += len;
        cmd[pos++] = '\r';
        cmd[pos++] = '\n';
    }
    assert(pos == totlen);
    cmd[pos] = '\0';

    *target = cmd;
    return totlen;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
pushq $-0x1
popq %rbx
testq %rdi, %rdi
je 0x48a9
movq %rcx, %r14
movl %esi, %ebp
movq %rdi, 0x18(%rsp)
movq %rdx, 0x8(%rsp)
movslq %esi, %r13
movq %r13, %rdi
callq 0x452f
movl %eax, %r12d
addl $0x3, %r12d
xorl %r15d, %r15d
testl %r13d, %r13d
movq 0x8(%rsp), %r13
movl $0x0, %eax
cmovgl %ebp, %eax
movq %rax, 0x10(%rsp)
cmpq %r15, 0x10(%rsp)
je 0x47df
testq %r14, %r14
je 0x47c5
movq (%r14,%r15,8), %rdi
jmp 0x47d2
movq (%r13,%r15,8), %rdi
callq 0x3140
movq %rax, %rdi
callq 0x451a
addl %eax, %r12d
incq %r15
jmp 0x47b3
leal 0x1(%r12), %eax
movslq %eax, %rdi
callq 0x3350
testq %rax, %rax
je 0x48a9
movq %rax, %r13
leaq 0x48d8(%rip), %rsi      # 0x90d7
movq %rax, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x3470
movl %eax, %ebp
xorl %r15d, %r15d
movq %r14, 0x20(%rsp)
cmpq %r15, 0x10(%rsp)
je 0x4890
movq %r14, %rax
movq %r12, %r14
testq %rax, %rax
je 0x4832
movq (%rax,%r15,8), %rbx
movq 0x8(%rsp), %r12
jmp 0x4843
movq 0x8(%rsp), %r12
movq (%r12,%r15,8), %rdi
callq 0x3140
movq %rax, %rbx
movslq %ebp, %rdi
addq %r13, %rdi
leaq 0x488d(%rip), %rsi      # 0x90dd
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3470
addl %ebp, %eax
movslq %eax, %rbp
movq %r13, %rdi
addq %rbp, %rdi
movq (%r12,%r15,8), %rsi
movq %rbx, %rdx
callq 0x3300
leal (%rbx,%rbp), %eax
cltq
movw $0xa0d, (%r13,%rax)     # imm = 0xA0D
addl %ebx, %ebp
addl $0x2, %ebp
incq %r15
movq %r14, %r12
movq 0x20(%rsp), %r14
jmp 0x4815
cmpl %r12d, %ebp
jne 0x48ba
movslq %r12d, %rax
movb $0x0, (%r13,%rax)
movq 0x18(%rsp), %rax
movq %r13, (%rax)
movl %r12d, %ebx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4823(%rip), %rdi      # 0x90e4
leaq 0x482a(%rip), %rsi      # 0x90f2
leaq 0x48dd(%rip), %rcx      # 0x91ac
movl $0x231, %edx            # imm = 0x231
callq 0x31c0
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/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);
        __redis_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 0x491f
movq %rdx, %r14
movq %rdx, %rdi
callq 0x3140
cmpq $0x7f, %rax
pushq $0x7f
popq %r15
cmovbq %rax, %r15
leaq 0x4(%rbx), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3300
movb $0x0, 0x4(%rbx,%r15)
popq %rbx
popq %r14
popq %r15
retq
cmpl $0x1, %esi
jne 0x4941
callq 0x3080
movl (%rax), %edi
addq $0x4, %rbx
movl $0x80, %edx
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x3100
leaq 0x48ac(%rip), %rdi      # 0x91f4
leaq 0x47a3(%rip), %rsi      # 0x90f2
leaq 0x48b3(%rip), %rcx      # 0x9209
movl $0x247, %edx            # imm = 0x247
callq 0x31c0
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: redisFree
void redisFree(redisContext *c) {
    if (c == NULL)
        return;
    if (c->fd > 0)
        close(c->fd);
    if (c->obuf != NULL)
        sdsfree(c->obuf);
    if (c->reader != NULL)
        redisReaderFree(c->reader);
    if (c->tcp.host)
        free(c->tcp.host);
    if (c->tcp.source_addr)
        free(c->tcp.source_addr);
    if (c->unix_sock.path)
        free(c->unix_sock.path);
    if (c->timeout)
        free(c->timeout);
    free(c);
}

// Assembly:
testq %rdi, %rdi
je 0x49df
pushq %rbx
movq %rdi, %rbx
movl 0x84(%rdi), %edi
testl %edi, %edi
jle 0x4984
callq 0x3210
movq 0x90(%rbx), %rdi
testq %rdi, %rdi
je 0x4995
callq 0x3290
movq 0x98(%rbx), %rdi
testq %rdi, %rdi
je 0x49a6
callq 0x34c0
movq 0xb0(%rbx), %rdi
callq 0x3050
movq 0xb8(%rbx), %rdi
callq 0x3050
movq 0xc8(%rbx), %rdi
callq 0x3050
movq 0xa8(%rbx), %rdi
callq 0x3050
movq %rbx, %rdi
popq %rbx
jmp 0x3050
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/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
orl $-0x1, 0x84(%rdi)
callq 0x3330
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: redisReconnect
int redisReconnect(redisContext *c) {
    c->err = 0;
    memset(c->errstr, '\0', strlen(c->errstr));

    if (c->fd > 0) {
        close(c->fd);
    }

    sdsfree(c->obuf);
    redisReaderFree(c->reader);

    c->obuf = sdsempty();
    c->reader = redisReaderCreate();

    if (c->connection_type == REDIS_CONN_TCP) {
        return redisContextConnectBindTcp(c, c->tcp.host, c->tcp.port,
                c->timeout, c->tcp.source_addr);
    } else if (c->connection_type == REDIS_CONN_UNIX) {
        return redisContextConnectUnix(c, c->unix_sock.path, c->timeout);
    } else {
        /* Something bad happened here and shouldn't have. There isn't
           enough information in the context to reconnect. */
        __redisSetError(c,REDIS_ERR_OTHER,"Not enough information to reconnect");
    }

    return REDIS_ERR;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
andl $0x0, (%rdi)
leaq 0x4(%rdi), %r14
movq %r14, %rdi
callq 0x3140
movq %r14, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x3200
movl 0x84(%rbx), %edi
testl %edi, %edi
jle 0x4a29
callq 0x3210
movq 0x90(%rbx), %rdi
callq 0x3290
movq 0x98(%rbx), %rdi
callq 0x34c0
callq 0x34a0
movq %rax, 0x90(%rbx)
callq 0x30a0
movq %rax, 0x98(%rbx)
movl 0xa0(%rbx), %eax
cmpl $0x1, %eax
je 0x4a92
testl %eax, %eax
jne 0x4aaf
movq 0xa8(%rbx), %rcx
movq 0xb0(%rbx), %rsi
movl 0xc0(%rbx), %edx
movq 0xb8(%rbx), %r8
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x32e0
movq 0xa8(%rbx), %rdx
movq 0xc8(%rbx), %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x32c0
leaq 0x478b(%rip), %rdx      # 0x9241
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x32b0
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: redisConnect
redisContext *redisConnect(const char *ip, int port) {
    redisContext *c;

    c = redisContextInit();
    if (c == NULL)
        return NULL;

    c->flags |= REDIS_BLOCK;
    redisContextConnectTcp(c,ip,port,NULL);
    return c;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
callq 0x4b00
movq %rax, %rbx
testq %rax, %rax
je 0x4af8
orb $0x1, 0x88(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x3410
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/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();
    c->tcp.host = NULL;
    c->tcp.source_addr = NULL;
    c->unix_sock.path = NULL;
    c->timeout = NULL;

    if (c->obuf == NULL || c->reader == NULL) {
        redisFree(c);
        return NULL;
    }

    return c;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
pushq $0x1
popq %rdi
movl $0xd0, %esi
callq 0x32a0
testq %rax, %rax
je 0x4b4e
movq %rax, %rbx
callq 0x34a0
movq %rax, %r14
movq %rax, 0x90(%rbx)
callq 0x30a0
movq %rax, 0x98(%rbx)
testq %r14, %r14
sete %cl
testq %rax, %rax
sete %al
orb %cl, %al
cmpb $0x1, %al
jne 0x4b50
movq %rbx, %rdi
callq 0x3330
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: redisConnectWithTimeout
redisContext *redisConnectWithTimeout(const char *ip, int port, const struct timeval tv) {
    redisContext *c;

    c = redisContextInit();
    if (c == NULL)
        return NULL;

    c->flags |= REDIS_BLOCK;
    redisContextConnectTcp(c,ip,port,&tv);
    return c;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
movq %rdi, %r15
movq %rdx, (%rsp)
movq %rcx, 0x8(%rsp)
callq 0x4b00
movq %rax, %r14
testq %rax, %rax
je 0x4b97
orb $0x1, 0x88(%r14)
movq %rsp, %rcx
movq %r14, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x3410
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: redisConnectNonBlock
redisContext *redisConnectNonBlock(const char *ip, int port) {
    redisContext *c;

    c = redisContextInit();
    if (c == NULL)
        return NULL;

    c->flags &= ~REDIS_BLOCK;
    redisContextConnectTcp(c,ip,port,NULL);
    return c;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
callq 0x4b00
movq %rax, %rbx
testq %rax, %rax
je 0x4bd0
andb $-0x2, 0x88(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x3410
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: redisConnectBindNonBlock
redisContext *redisConnectBindNonBlock(const char *ip, int port,
                                       const char *source_addr) {
    redisContext *c = redisContextInit();
    c->flags &= ~REDIS_BLOCK;
    redisContextConnectBindTcp(c,ip,port,NULL,source_addr);
    return c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
callq 0x4b00
movq %rax, %r15
andb $-0x2, 0x88(%rax)
movq %rax, %rdi
movq %r14, %rsi
movl %ebp, %edx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x32e0
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: redisConnectUnix
redisContext *redisConnectUnix(const char *path) {
    redisContext *c;

    c = redisContextInit();
    if (c == NULL)
        return NULL;

    c->flags |= REDIS_BLOCK;
    redisContextConnectUnix(c,path,NULL);
    return c;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x4b00
movq %rax, %rbx
testq %rax, %rax
je 0x4c8d
orb $0x1, 0x88(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x32c0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: redisConnectUnixWithTimeout
redisContext *redisConnectUnixWithTimeout(const char *path, const struct timeval tv) {
    redisContext *c;

    c = redisContextInit();
    if (c == NULL)
        return NULL;

    c->flags |= REDIS_BLOCK;
    redisContextConnectUnix(c,path,&tv);
    return c;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq %rsi, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
callq 0x4b00
movq %rax, %r14
testq %rax, %rax
je 0x4cd1
orb $0x1, 0x88(%r14)
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x32c0
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: redisConnectUnixNonBlock
redisContext *redisConnectUnixNonBlock(const char *path) {
    redisContext *c;

    c = redisContextInit();
    if (c == NULL)
        return NULL;

    c->flags &= ~REDIS_BLOCK;
    redisContextConnectUnix(c,path,NULL);
    return c;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x4b00
movq %rax, %rbx
testq %rax, %rax
je 0x4d04
andb $-0x2, 0x88(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x32c0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: redisBufferRead
int redisBufferRead(redisContext *c) {
    char buf[1024*16];
    int nread;

    /* Return early when the context has seen an error. */
    if (c->err)
        return REDIS_ERR;

    nread = read(c->fd,buf,sizeof(buf));
    if (nread == -1) {
        if ((errno == EAGAIN && !(c->flags & REDIS_BLOCK)) || (errno == EINTR)) {
            /* Try again later */
        } else {
            __redisSetError(c,REDIS_ERR_IO,NULL);
            return REDIS_ERR;
        }
    } else if (nread == 0) {
        __redisSetError(c,REDIS_ERR_EOF,"Server closed the connection");
        return REDIS_ERR;
    } else {
        if (redisReaderFeed(c->reader,buf,nread) != REDIS_OK) {
            __redisSetError(c,c->reader->err,c->reader->errstr);
            return REDIS_ERR;
        }
    }
    return REDIS_OK;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x4008, %rsp           # imm = 0x4008
pushq $-0x1
popq %rbp
cmpl $0x0, (%rdi)
jne 0x4ddc
movq %rdi, %rbx
movl 0x84(%rdi), %edi
movq %rsp, %rsi
movl $0x4000, %edx           # imm = 0x4000
callq 0x3260
testl %eax, %eax
je 0x4da5
cmpl $-0x1, %eax
jne 0x4db1
callq 0x3080
movl (%rax), %ecx
xorl %eax, %eax
cmpl $0x4, %ecx
je 0x4dde
cmpl $0xb, %ecx
jne 0x4d9b
testb $0x1, 0x88(%rbx)
je 0x4dde
pushq $0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
jmp 0x4dd7
leaq 0x44b9(%rip), %rdx      # 0x9265
pushq $0x3
popq %rsi
jmp 0x4dd4
movq 0x98(%rbx), %rdi
movslq %eax, %rdx
movq %rsp, %rsi
callq 0x31b0
testl %eax, %eax
je 0x4de8
movq 0x98(%rbx), %rdx
movl (%rdx), %esi
addq $0x4, %rdx
movq %rbx, %rdi
callq 0x32b0
movl %ebp, %eax
addq $0x4008, %rsp           # imm = 0x4008
popq %rbx
popq %rbp
retq
xorl %eax, %eax
jmp 0x4dde
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: redisBufferWrite
int redisBufferWrite(redisContext *c, int *done) {
    int nwritten;

    /* Return early when the context has seen an error. */
    if (c->err)
        return REDIS_ERR;

    if (sdslen(c->obuf) > 0) {
        nwritten = write(c->fd,c->obuf,sdslen(c->obuf));
        if (nwritten == -1) {
            if ((errno == EAGAIN && !(c->flags & REDIS_BLOCK)) || (errno == EINTR)) {
                /* Try again later */
            } else {
                __redisSetError(c,REDIS_ERR_IO,NULL);
                return REDIS_ERR;
            }
        } else if (nwritten > 0) {
            if (nwritten == (signed)sdslen(c->obuf)) {
                sdsfree(c->obuf);
                c->obuf = sdsempty();
            } else {
                sdsrange(c->obuf,nwritten,-1);
            }
        }
    }
    if (done != NULL) *done = (sdslen(c->obuf) == 0);
    return REDIS_OK;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
pushq $-0x1
popq %rbp
cmpl $0x0, (%rdi)
jne 0x4e93
movq %rsi, %rbx
movq %rdi, %r14
movq 0x90(%rdi), %rsi
movslq -0x8(%rsi), %rdx
testq %rdx, %rdx
je 0x4e7a
movl 0x84(%r14), %edi
callq 0x3130
cmpl $-0x1, %eax
je 0x4e46
testl %eax, %eax
jle 0x4e7a
movq 0x90(%r14), %rdi
cmpl %eax, -0x8(%rdi)
jne 0x4e70
callq 0x3290
callq 0x34a0
movq %rax, 0x90(%r14)
jmp 0x4e7a
callq 0x3080
movl (%rax), %eax
cmpl $0x4, %eax
je 0x4e7a
cmpl $0xb, %eax
jne 0x4e61
testb $0x1, 0x88(%r14)
je 0x4e7a
pushq $0x1
popq %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x32b0
jmp 0x4e93
pushq $-0x1
popq %rdx
movl %eax, %esi
callq 0x3230
xorl %ebp, %ebp
testq %rbx, %rbx
je 0x4e93
movq 0x90(%r14), %rax
xorl %ecx, %ecx
cmpl $0x0, -0x8(%rax)
sete %cl
movl %ecx, (%rbx)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: redisGetReply
int redisGetReply(redisContext *c, void **reply) {
    int wdone = 0;
    void *aux = NULL;

    /* Try to read pending replies */
    if (redisGetReplyFromReader(c,&aux) == REDIS_ERR)
        return REDIS_ERR;

    /* For the blocking context, flush output buffer and read reply */
    if (aux == NULL && c->flags & REDIS_BLOCK) {
        /* Write until done */
        do {
            if (redisBufferWrite(c,&wdone) == REDIS_ERR)
                return REDIS_ERR;
        } while (!wdone);

        /* Read until there is a reply */
        do {
            if (redisBufferRead(c) == REDIS_ERR)
                return REDIS_ERR;
            if (redisGetReplyFromReader(c,&aux) == REDIS_ERR)
                return REDIS_ERR;
        } while (aux == NULL);
    }

    /* Set reply object */
    if (reply != NULL) *reply = aux;
    return REDIS_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %r15
andl $0x0, 0xc(%rsp)
leaq 0x10(%rsp), %rsi
andq $0x0, (%rsi)
callq 0x3240
pushq $-0x1
popq %rbx
cmpl $-0x1, %eax
je 0x4f19
movq 0x10(%rsp), %rax
testq %rax, %rax
jne 0x4f0f
testb $0x1, 0x88(%r15)
jne 0x4f27
xorl %eax, %eax
xorl %ebx, %ebx
testq %r14, %r14
je 0x4f19
movq %rax, (%r14)
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0xc(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x3120
cmpl $-0x1, %eax
je 0x4f19
cmpl $0x0, 0xc(%rsp)
je 0x4f2c
leaq 0x10(%rsp), %r12
movq %r15, %rdi
callq 0x3460
cmpl $-0x1, %eax
je 0x4f19
movq %r15, %rdi
movq %r12, %rsi
callq 0x3240
cmpl $-0x1, %eax
je 0x4f19
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x4f48
jmp 0x4f0f
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: _redisAppendCommand
int __redisAppendCommand(redisContext *c, const char *cmd, size_t len) {
    sds newbuf;

    newbuf = sdscatlen(c->obuf,cmd,len);
    if (newbuf == NULL) {
        __redisSetError(c,REDIS_ERR_OOM,"Out of memory");
        return REDIS_ERR;
    }

    c->obuf = newbuf;
    return REDIS_OK;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x90(%rdi), %rdi
callq 0x3430
testq %rax, %rax
je 0x4f91
movq %rax, 0x90(%rbx)
xorl %eax, %eax
jmp 0x4fa6
leaq 0x42ea(%rip), %rdx      # 0x9282
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x32b0
pushq $-0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/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;
    } else if (len == -2) {
        __redisSetError(c,REDIS_ERR_OTHER,"Invalid format string");
        return REDIS_ERR;
    }

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

    free(cmd);
    return REDIS_OK;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3500
cmpl $-0x2, %eax
je 0x4fdf
cmpl $-0x1, %eax
jne 0x4ff6
leaq 0x42a7(%rip), %rdx      # 0x9282
pushq $0x5
jmp 0x4fe8
leaq 0x42aa(%rip), %rdx      # 0x9290
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x32b0
pushq $-0x1
popq %rax
jmp 0x5018
movq 0x8(%rsp), %rsi
movslq %eax, %rdx
movq %rbx, %rdi
callq 0x3570
movl %eax, %ebx
movq 0x8(%rsp), %rdi
callq 0x3050
xorl %eax, %eax
negl %ebx
sbbl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: redisAppendCommandArgv
int redisAppendCommandArgv(redisContext *c, int argc, const char **argv, const size_t *argvlen) {
    sds cmd;
    int len;

    len = redisFormatSdsCommandArgv(&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) {
        sdsfree(cmd);
        return REDIS_ERR;
    }

    sdsfree(cmd);
    return REDIS_OK;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x31e0
cmpl $-0x1, %eax
je 0x50dd
movq 0x8(%rsp), %rsi
movslq %eax, %rdx
movq %rbx, %rdi
callq 0x3570
movl %eax, %ebx
movq 0x8(%rsp), %rdi
callq 0x3290
xorl %eax, %eax
negl %ebx
sbbl %eax, %eax
jmp 0x50f2
leaq 0x419e(%rip), %rdx      # 0x9282
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x32b0
pushq $-0x1
popq %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: createStringObject
static void *createStringObject(const redisReadTask *task, char *str, size_t len) {
    redisReply *r, *parent;
    char *buf;

    r = createReplyObject(task->type);
    if (r == NULL)
        return NULL;

    buf = malloc(len+1);
    if (buf == NULL) {
        freeReplyObject(r);
        return NULL;
    }

    assert(task->type == REDIS_REPLY_ERROR  ||
           task->type == REDIS_REPLY_STATUS ||
           task->type == REDIS_REPLY_STRING);

    /* Copy string value */
    memcpy(buf,str,len);
    buf[len] = '\0';
    r->str = buf;
    r->len = len;

    if (task->parent) {
        parent = task->parent->obj;
        assert(parent->type == REDIS_REPLY_ARRAY);
        parent->element[task->idx] = r;
    }
    return r;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movl (%rdi), %edi
callq 0x53dc
testq %rax, %rax
je 0x5259
movq %rax, %rbx
leaq 0x1(%r15), %rdi
callq 0x3350
testq %rax, %rax
je 0x5251
movq %rax, %r13
movl (%r14), %eax
cmpl $0x6, %eax
ja 0x5287
pushq $0x62
popq %rcx
btl %eax, %ecx
jae 0x5287
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x3300
movb $0x0, (%r13,%r15)
movq %r13, 0x18(%rbx)
movl %r15d, 0x10(%rbx)
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x525b
movq 0x10(%rax), %rax
cmpl $0x2, (%rax)
jne 0x5268
movq 0x28(%rax), %rax
movslq 0x8(%r14), %rcx
movq %rbx, (%rax,%rcx,8)
jmp 0x525b
movq %rbx, %rdi
callq 0x3400
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x40df(%rip), %rdi      # 0x934e
leaq 0x3e7c(%rip), %rsi      # 0x90f2
leaq 0x4091(%rip), %rcx      # 0x930e
movl $0x80, %edx
callq 0x31c0
leaq 0x4018(%rip), %rdi      # 0x92a6
leaq 0x3e5d(%rip), %rsi      # 0x90f2
leaq 0x4072(%rip), %rcx      # 0x930e
pushq $0x76
popq %rdx
callq 0x31c0
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: createArrayObject
static void *createArrayObject(const redisReadTask *task, int elements) {
    redisReply *r, *parent;

    r = createReplyObject(REDIS_REPLY_ARRAY);
    if (r == NULL)
        return NULL;

    if (elements > 0) {
        r->element = calloc(elements,sizeof(redisReply*));
        if (r->element == NULL) {
            freeReplyObject(r);
            return NULL;
        }
    }

    r->elements = elements;

    if (task->parent) {
        parent = task->parent->obj;
        assert(parent->type == REDIS_REPLY_ARRAY);
        parent->element[task->idx] = r;
    }
    return r;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
pushq $0x2
popq %rdi
callq 0x53dc
testq %rax, %rax
je 0x5303
movq %rax, %rbx
testl %ebp, %ebp
jle 0x52d4
movl %ebp, %edi
pushq $0x8
popq %rsi
callq 0x32a0
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x52fb
movslq %ebp, %rax
movq %rax, 0x20(%rbx)
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x5305
movq 0x10(%rax), %rax
cmpl $0x2, (%rax)
jne 0x530d
movq 0x28(%rax), %rax
movslq 0x8(%r14), %rcx
movq %rbx, (%rax,%rcx,8)
jmp 0x5305
movq %rbx, %rdi
callq 0x3400
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x403a(%rip), %rdi      # 0x934e
leaq 0x3dd7(%rip), %rsi      # 0x90f2
leaq 0x404e(%rip), %rcx      # 0x9370
movl $0x99, %edx
callq 0x31c0
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: createIntegerObject
static void *createIntegerObject(const redisReadTask *task, long long value) {
    redisReply *r, *parent;

    r = createReplyObject(REDIS_REPLY_INTEGER);
    if (r == NULL)
        return NULL;

    r->integer = value;

    if (task->parent) {
        parent = task->parent->obj;
        assert(parent->type == REDIS_REPLY_ARRAY);
        parent->element[task->idx] = r;
    }
    return r;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x3
popq %rdi
callq 0x53dc
testq %rax, %rax
je 0x5365
movq %r14, 0x8(%rax)
movq 0x18(%rbx), %rcx
testq %rcx, %rcx
je 0x5365
movq 0x10(%rcx), %rcx
cmpl $0x2, (%rcx)
jne 0x536d
movq 0x28(%rcx), %rcx
movslq 0x8(%rbx), %rdx
movq %rax, (%rcx,%rdx,8)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x3fda(%rip), %rdi      # 0x934e
leaq 0x3d77(%rip), %rsi      # 0x90f2
leaq 0x4022(%rip), %rcx      # 0x93a4
movl $0xaa, %edx
callq 0x31c0
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: createNilObject
static void *createNilObject(const redisReadTask *task) {
    redisReply *r, *parent;

    r = createReplyObject(REDIS_REPLY_NIL);
    if (r == NULL)
        return NULL;

    if (task->parent) {
        parent = task->parent->obj;
        assert(parent->type == REDIS_REPLY_ARRAY);
        parent->element[task->idx] = r;
    }
    return r;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x4
popq %rdi
callq 0x53dc
testq %rax, %rax
je 0x53bb
movq 0x18(%rbx), %rcx
testq %rcx, %rcx
je 0x53bb
movq 0x10(%rcx), %rcx
cmpl $0x2, (%rcx)
jne 0x53bd
movq 0x28(%rcx), %rcx
movslq 0x8(%rbx), %rdx
movq %rax, (%rcx,%rdx,8)
popq %rbx
retq
leaq 0x3f8a(%rip), %rdi      # 0x934e
leaq 0x3d27(%rip), %rsi      # 0x90f2
leaq 0x400e(%rip), %rcx      # 0x93e0
movl $0xb9, %edx
callq 0x31c0
// File: /workspace/github_c_makefile_star2_O2/andyfighting[P]hiredis_timer_cmpt/hiredis.c
// Function: createReplyObject
static redisReply *createReplyObject(int type) {
    redisReply *r = calloc(1,sizeof(*r));

    if (r == NULL)
        return NULL;

    r->type = type;
    return r;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0x32a0
testq %rax, %rax
je 0x53f1
movl %ebx, (%rax)
popq %rbx
retq
nop