// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: cliConnect
static int cliConnect(int force) {
    if (context == NULL || force) {
        if (context != NULL) {
            redisFree(context);
        }

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

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

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
cmpq $0x0, 0x8d095(%rip)     # 0xa15d8
je 0x1454f
cmpl $0x0, -0x8(%rbp)
je 0x1468e
cmpq $0x0, 0x8d081(%rip)     # 0xa15d8
je 0x14565
movq 0x8d078(%rip), %rdi     # 0xa15d8
callq 0x1cb90
cmpq $0x0, 0x8cf2b(%rip)     # 0xa1498
jne 0x1458a
movq 0x8cf12(%rip), %rdi     # 0xa1488
movl 0x8cf14(%rip), %esi     # 0xa1490
callq 0x1cc50
movq %rax, 0x8d050(%rip)     # 0xa15d8
jmp 0x1459d
movq 0x8cf07(%rip), %rdi     # 0xa1498
callq 0x1ce80
movq %rax, 0x8d03b(%rip)     # 0xa15d8
movq 0x8d034(%rip), %rax     # 0xa15d8
cmpl $0x0, (%rax)
je 0x1464b
movq 0x8aa3c(%rip), %rax     # 0x9eff0
movq (%rax), %rdi
leaq 0x77756(%rip), %rsi     # 0x8bd14
movb $0x0, %al
callq 0x10360
cmpq $0x0, 0x8cecb(%rip)     # 0xa1498
jne 0x14601
movq 0x8aa1a(%rip), %rax     # 0x9eff0
movq (%rax), %rdi
movq 0x8cea8(%rip), %rdx     # 0xa1488
movl 0x8ceaa(%rip), %ecx     # 0xa1490
movq 0x8cfeb(%rip), %r8      # 0xa15d8
addq $0x4, %r8
leaq 0x7773b(%rip), %rsi     # 0x8bd33
movb $0x0, %al
callq 0x10360
jmp 0x1462b
movq 0x8a9e8(%rip), %rax     # 0x9eff0
movq (%rax), %rdi
movq 0x8ce86(%rip), %rdx     # 0xa1498
movq 0x8cfbf(%rip), %rcx     # 0xa15d8
addq $0x4, %rcx
leaq 0x7771a(%rip), %rsi     # 0x8bd3e
movb $0x0, %al
callq 0x10360
movq 0x8cfa6(%rip), %rdi     # 0xa15d8
callq 0x1cb90
movq $0x0, 0x8cf96(%rip) # 0xa15d8
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x14695
movq 0x8cf86(%rip), %rax     # 0xa15d8
movl 0x84(%rax), %esi
xorl %eax, %eax
movl %eax, %edi
movl $0xf, %edx
callq 0x10a10
callq 0x16e30
cmpl $0x0, %eax
je 0x14679
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x14695
callq 0x16ea0
cmpl $0x0, %eax
je 0x1468c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x14695
jmp 0x1468e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nop