// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/src/redis-benchmark.c
// Function: createClient
static client createClient(char *cmd, size_t len, client from) {
    int j;
    client c = zmalloc(sizeof(struct _client));

    if (config.hostsocket == NULL) {
        c->context = redisConnectNonBlock(config.hostip,config.hostport);
    } else {
        c->context = redisConnectUnixNonBlock(config.hostsocket);
    }
    if (c->context->err) {
        fprintf(stderr,"Could not connect to Redis at ");
        if (config.hostsocket == NULL)
            fprintf(stderr,"%s:%d: %s\n",config.hostip,config.hostport,c->context->errstr);
        else
            fprintf(stderr,"%s: %s\n",config.hostsocket,c->context->errstr);
        exit(1);
    }
    /* Suppress hiredis cleanup of unused buffers for max speed. */
    c->context->reader->maxbuf = 0;

    /* Build the request buffer:
     * Queue N requests accordingly to the pipeline size, or simply clone
     * the example client buffer. */
    c->obuf = sdsempty();

    /* If a DB number different than zero is selected, prefix our request
     * buffer with the SELECT command, that will be discarded the first
     * time the replies are received, so if the client is reused the
     * SELECT command will not be used again. */
    if (config.dbnum != 0) {
        c->obuf = sdscatprintf(c->obuf,"*2\r\n$6\r\nSELECT\r\n$%d\r\n%s\r\n",
            (int)sdslen(config.dbnumstr),config.dbnumstr);
        c->selectlen = sdslen(c->obuf);
    } else {
        c->selectlen = 0;
    }

    /* Append the request itself. */
    if (from) {
        c->obuf = sdscatlen(c->obuf,
            from->obuf+from->selectlen,
            sdslen(from->obuf)-from->selectlen);
    } else {
        for (j = 0; j < config.pipeline; j++)
            c->obuf = sdscatlen(c->obuf,cmd,len);
    }
    c->written = 0;
    c->pending = config.pipeline;
    c->randptr = NULL;
    c->randlen = 0;
    if (c->selectlen) c->pending++;

    /* Find substrings in the output buffer that need to be randomized. */
    if (config.randomkeys) {
        if (from) {
            c->randlen = from->randlen;
            c->randfree = 0;
            c->randptr = zmalloc(sizeof(char*)*c->randlen);
            /* copy the offsets. */
            for (j = 0; j < c->randlen; j++) {
                c->randptr[j] = c->obuf + (from->randptr[j]-from->obuf);
                /* Adjust for the different select prefix length. */
                c->randptr[j] += c->selectlen - from->selectlen;
            }
        } else {
            char *p = c->obuf;

            c->randlen = 0;
            c->randfree = RANDPTR_INITIAL_SIZE;
            c->randptr = zmalloc(sizeof(char*)*c->randfree);
            while ((p = strstr(p,"__rand_int__")) != NULL) {
                if (c->randfree == 0) {
                    c->randptr = zrealloc(c->randptr,sizeof(char*)*c->randlen*2);
                    c->randfree += c->randlen;
                }
                c->randptr[c->randlen++] = p;
                c->randfree--;
                p += 12; /* 12 is strlen("__rand_int__). */
            }
        }
    }
    aeCreateFileEvent(config.el,c->context->fd,AE_WRITABLE,writeHandler,c);
    listAddNodeTail(config.clients,c);
    config.liveclients++;
    return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x48, %edi
callq 0x108e0
movq %rax, -0x28(%rbp)
cmpq $0x0, 0x44416(%rip)     # 0x513d0
jne 0xcfda
movq 0x443fd(%rip), %rdi     # 0x513c0
movl 0x443ff(%rip), %esi     # 0x513c8
callq 0x129c0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
jmp 0xcff0
movq 0x443ef(%rip), %rdi     # 0x513d0
callq 0x12ab0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rax
cmpl $0x0, (%rax)
je 0xd088
movq 0x43fe9(%rip), %rax     # 0x50ff0
movq (%rax), %rdi
leaq 0x34ddc(%rip), %rsi     # 0x41ded
movb $0x0, %al
callq 0x92e0
cmpq $0x0, 0x443b0(%rip)     # 0x513d0
jne 0xd054
movq 0x43fc7(%rip), %rax     # 0x50ff0
movq (%rax), %rdi
movq 0x4438d(%rip), %rdx     # 0x513c0
movl 0x4438f(%rip), %ecx     # 0x513c8
movq -0x28(%rbp), %rax
movq (%rax), %r8
addq $0x4, %r8
leaq 0x34dc1(%rip), %rsi     # 0x41e0c
movb $0x0, %al
callq 0x92e0
jmp 0xd07e
movq 0x43f95(%rip), %rax     # 0x50ff0
movq (%rax), %rdi
movq 0x4436b(%rip), %rdx     # 0x513d0
movq -0x28(%rbp), %rax
movq (%rax), %rcx
addq $0x4, %rcx
leaq 0x34da0(%rip), %rsi     # 0x41e17
movb $0x0, %al
callq 0x92e0
movl $0x1, %edi
callq 0x9500
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq 0x98(%rax), %rax
movq $0x0, 0xa0(%rax)
callq 0xdfb0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
cmpl $0x0, 0x44388(%rip)     # 0x51440
je 0xd110
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq 0x4437b(%rip), %rdi     # 0x51448
callq 0xc010
movq -0x38(%rbp), %rdi
movl %eax, %edx
movq 0x44369(%rip), %rcx     # 0x51448
leaq 0x34d39(%rip), %rsi     # 0x41e1f
movb $0x0, %al
callq 0xe9c0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xc010
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x44(%rax)
jmp 0xd11b
movq -0x28(%rbp), %rax
movl $0x0, 0x44(%rax)
cmpq $0x0, -0x18(%rbp)
je 0xd17a
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movslq 0x44(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xc010
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq %rax, %rdx
movq -0x18(%rbp), %rax
movslq 0x44(%rax), %rax
subq %rax, %rdx
callq 0xe3f0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0xd1b9
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl 0x44276(%rip), %eax     # 0x51400
jge 0xd1b7
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0xe3f0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xd181
jmp 0xd1b9
movq -0x28(%rbp), %rax
movl $0x0, 0x28(%rax)
movl 0x44236(%rip), %ecx     # 0x51400
movq -0x28(%rbp), %rax
movl %ecx, 0x40(%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x28(%rbp), %rax
cmpl $0x0, 0x44(%rax)
je 0xd200
movq -0x28(%rbp), %rax
movl 0x40(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x40(%rax)
cmpl $0x0, 0x441ed(%rip)     # 0x513f4
je 0xd3bf
cmpq $0x0, -0x18(%rbp)
je 0xd2d3
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
shlq $0x3, %rdi
callq 0x108e0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jae 0xd2ce
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x18(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq %rcx, %rax
addq %rax, %rdx
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
movl 0x44(%rax), %esi
movq -0x18(%rbp), %rax
subl 0x44(%rax), %esi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movslq %esi, %rsi
addq %rsi, %rdx
movq %rdx, (%rax,%rcx,8)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xd257
jmp 0xd3bd
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x28(%rbp), %rax
movq $0x8, 0x20(%rax)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rdi
shlq $0x3, %rdi
callq 0x108e0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rdi
leaq 0x3490e(%rip), %rsi     # 0x41c2c
callq 0x9580
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0xd3bb
movq -0x28(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0xd377
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rsi
shlq $0x3, %rsi
shlq %rsi
callq 0x10a20
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x28(%rbp), %rax
addq 0x20(%rax), %rcx
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %rdx
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x28(%rbp), %rsi
movq 0x18(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x18(%rsi)
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %rax
addq $0xc, %rax
movq %rax, -0x30(%rbp)
jmp 0xd313
jmp 0xd3bd
jmp 0xd3bf
movq 0x43ff2(%rip), %rdi     # 0x513b8
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl 0x84(%rax), %esi
movq -0x28(%rbp), %r8
movl $0x2, %edx
leaq 0x17d(%rip), %rcx       # 0xd560
callq 0x9b00
movq 0x44039(%rip), %rdi     # 0x51428
movq -0x28(%rbp), %rsi
callq 0x101e0
movl 0x43fde(%rip), %eax     # 0x513dc
addl $0x1, %eax
movl %eax, 0x43fd5(%rip)     # 0x513dc
movq -0x28(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)