// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/redis-cli.c
// Function: repl
static void repl(void) {
    sds historyfile = NULL;
    int history = 0;
    char *line;
    int argc;
    sds *argv;

    /* Initialize the help and, if possible, use the COMMAND command in order
     * to retrieve missing entries. */
    cliInitHelp();
    cliIntegrateHelp();

    config.interactive = 1;
    linenoiseSetMultiLine(1);
    linenoiseSetCompletionCallback(completionCallback);
    linenoiseSetHintsCallback(hintsCallback);
    linenoiseSetFreeHintsCallback(freeHintsCallback);

    /* Only use history and load the rc file when stdin is a tty. */
    if (isatty(fileno(stdin))) {
        historyfile = getDotfilePath(REDIS_CLI_HISTFILE_ENV,REDIS_CLI_HISTFILE_DEFAULT);
        if (historyfile != NULL) {
            history = 1;
            linenoiseHistoryLoad(historyfile);
        }
        cliLoadPreferences();
    }

    cliRefreshPrompt();
    while((line = linenoise(context ? config.prompt : "not connected> ")) != NULL) {
        if (line[0] != '\0') {
            argv = cliSplitArgs(line,&argc);
            if (history) linenoiseHistoryAdd(line);
            if (historyfile) linenoiseHistorySave(historyfile);

            if (argv == NULL) {
                printf("Invalid argument(s)\n");
                linenoiseFree(line);
                continue;
            } else if (argc > 0) {
                if (strcasecmp(argv[0],"quit") == 0 ||
                    strcasecmp(argv[0],"exit") == 0)
                {
                    exit(0);
                } else if (argv[0][0] == ':') {
                    cliSetPreferences(argv,argc,1);
                    continue;
                } else if (strcasecmp(argv[0],"restart") == 0) {
                    if (config.eval) {
                        config.eval_ldb = 1;
                        config.output = OUTPUT_RAW;
                        return; /* Return to evalMode to restart the session. */
                    } else {
                        printf("Use 'restart' only in Lua debugging mode.");
                    }
                } else if (argc == 3 && !strcasecmp(argv[0],"connect")) {
                    sdsfree(config.hostip);
                    config.hostip = sdsnew(argv[1]);
                    config.hostport = atoi(argv[2]);
                    cliRefreshPrompt();
                    cliConnect(1);
                } else if (argc == 1 && !strcasecmp(argv[0],"clear")) {
                    linenoiseClearScreen();
                } else {
                    long long start_time = mstime(), elapsed;
                    int repeat, skipargs = 0;
                    char *endptr;

                    repeat = strtol(argv[0], &endptr, 10);
                    if (argc > 1 && *endptr == '\0' && repeat) {
                        skipargs = 1;
                    } else {
                        repeat = 1;
                    }

                    issueCommandRepeat(argc-skipargs, argv+skipargs, repeat);

                    /* If our debugging session ended, show the EVAL final
                     * reply. */
                    if (config.eval_ldb_end) {
                        config.eval_ldb_end = 0;
                        cliReadReply(0);
                        printf("\n(Lua debugging session ended%s)\n\n",
                            config.eval_ldb_sync ? "" :
                            " -- dataset changes rolled back");
                    }

                    elapsed = mstime()-start_time;
                    if (elapsed >= 500 &&
                        config.output == OUTPUT_STANDARD)
                    {
                        printf("(%.2fs)\n",(double)elapsed/1000);
                    }
                }
            }
            /* Free the argument vector */
            sdsfreesplitres(argv,argc);
        }
        /* linenoise() returns malloc-ed lines like readline() */
        linenoiseFree(line);
    }
    exit(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl $0xd3, 0x41cea(%rip)    # 0x56564
movl $0x1a60, %edi           # imm = 0x1A60
callq 0x163fd
movq %rax, 0x41cdd(%rip)     # 0x56568
leaq 0x14(%rsp), %rbx
pushq $0x8
popq %r14
leaq 0x3db15(%rip), %r13     # 0x523b0
leaq 0x2be70(%rip), %r15     # 0x40712
xorl %ebp, %ebp
cmpq $0x70, %rbp
je 0x14912
movl $0x1, 0x14(%rsp)
movq %r14, %rdi
callq 0x163fd
movq %rax, %r12
movq %rax, 0x18(%rsp)
callq 0x18ec4
movq (%rbp,%r13), %rdx
movq %rax, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x197b0
movq %rax, (%r12)
movq %rax, 0x20(%rsp)
movl $0x2, 0x10(%rsp)
andq $0x0, 0x28(%rsp)
movq 0x41c71(%rip), %rax     # 0x56568
movups 0x10(%rsp), %xmm0
movups %xmm0, (%rax,%rbp,4)
movupd 0x20(%rsp), %xmm0
movupd %xmm0, 0x10(%rax,%rbp,4)
addq $0x8, %rbp
jmp 0x148a4
movl $0x1c0, %r14d           # imm = 0x1C0
leaq 0x3faa1(%rip), %r15     # 0x543c0
cmpq $0x1a60, %r14           # imm = 0x1A60
je 0x1497a
movq (%r15), %rdi
movq %rbx, %rsi
callq 0x1a100
movq %rax, 0x18(%rsp)
movq (%r15), %rdi
callq 0x18ed2
movq %rax, 0x20(%rsp)
movl $0x1, 0x10(%rsp)
movq %r15, 0x28(%rsp)
movq 0x41c0f(%rip), %rax     # 0x56568
movups 0x10(%rsp), %xmm0
movups %xmm0, (%rax,%r14)
movupd 0x20(%rsp), %xmm0
movupd %xmm0, 0x10(%rax,%r14)
addq $0x20, %r14
addq $0x28, %r15
jmp 0x1491f
xorl %edi, %edi
callq 0x1465e
cmpl $-0x1, %eax
je 0x14ba9
movq 0x41bc7(%rip), %rdi     # 0x56558
leaq 0x276d4(%rip), %rsi     # 0x3c06c
xorl %eax, %eax
callq 0x18878
testq %rax, %rax
je 0x14ba9
movq %rax, %rdi
cmpl $0x2, (%rax)
jne 0x14ba9
xorl %esi, %esi
movq %rdi, 0x30(%rsp)
cmpq 0x20(%rdi), %rsi
jae 0x14ba4
movq 0x28(%rdi), %rax
movq (%rax,%rsi,8), %rbx
cmpl $0x2, (%rbx)
jne 0x14ba9
cmpq $0x4, 0x20(%rbx)
jb 0x14ba9
movq 0x28(%rbx), %rcx
movq (%rcx), %rax
cmpl $0x1, (%rax)
jne 0x14ba9
movq 0x8(%rcx), %rdx
cmpl $0x3, (%rdx)
jne 0x14ba9
movq 0x18(%rcx), %rcx
cmpl $0x3, (%rcx)
jne 0x14ba9
movq %rsi, 0x40(%rsp)
movq 0x18(%rax), %r12
movslq 0x41b49(%rip), %r13     # 0x56564
movq 0x41b46(%rip), %rax     # 0x56568
testl %r13d, %r13d
movl $0x0, %ebp
cmovgl %r13d, %ebp
movq %rax, 0x38(%rsp)
leaq 0x8(%rax), %r14
xorl %r15d, %r15d
cmpq %r15, %rbp
je 0x14a5d
movq (%r14), %rax
movq (%rax), %rdi
movq %r12, %rsi
callq 0x10080
testl %eax, %eax
je 0x14a5a
incq %r15
addq $0x20, %r14
jmp 0x14a3a
movl %r15d, %ebp
cmpl %r13d, %ebp
jne 0x14b92
incq %r13
movl %r13d, 0x41af4(%rip)    # 0x56564
shlq $0x5, %r13
movq 0x38(%rsp), %rdi
movq %r13, %rsi
callq 0x164a7
movq %rax, %r13
movq %rax, 0x41add(%rip)     # 0x56568
movslq 0x41ad2(%rip), %r14     # 0x56564
shlq $0x5, %r14
pushq $0x1
popq %rbp
movl %ebp, -0x1c(%rax,%r14)
pushq $0x8
popq %rdi
callq 0x163fd
movq %rax, -0x18(%r13,%r14)
movq %r12, %rdi
callq 0x18ed2
movq -0x18(%r13,%r14), %rcx
movq %rax, (%rcx)
movq -0x18(%r13,%r14), %rax
movq (%rax), %rdi
movq %rdi, -0x10(%r13,%r14)
movl %ebp, -0x20(%r13,%r14)
callq 0x19cf2
pushq $0x28
popq %rdi
callq 0x163fd
movq %rax, %r12
movq -0x18(%r13,%r14), %rax
movq (%rax), %rax
movq %rax, (%r12)
callq 0x18ec4
movq %rax, 0x8(%r12)
movq 0x28(%rbx), %rcx
movq 0x8(%rcx), %rdx
movq 0x18(%rcx), %rcx
movq 0x8(%rdx), %rdx
movq %rdx, %r15
negq %r15
cmovsq %rdx, %r15
cmpq $0x1, 0x8(%rcx)
jne 0x14b2b
movq %rax, %rdi
leaq 0x2bc41(%rip), %rsi     # 0x4075f
callq 0x1952f
movq %rax, 0x8(%r12)
decl %r15d
addq %r14, %r13
leaq 0x2bc2f(%rip), %r14     # 0x40764
subl $0x1, %r15d
jb 0x14b4d
movq %rax, %rdi
movq %r14, %rsi
callq 0x1952f
movq %rax, 0x8(%r12)
jmp 0x14b35
movq 0x28(%rbx), %rcx
movq 0x8(%rcx), %rcx
cmpq $0x0, 0x8(%rcx)
jns 0x14b70
movq %rax, %rdi
leaq 0x2bc03(%rip), %rsi     # 0x40769
callq 0x1952f
movq %rax, 0x8(%r12)
leaq 0x2bc00(%rip), %rax     # 0x40777
movq %rax, 0x10(%r12)
andl $0x0, 0x18(%r12)
leaq 0x2bc01(%rip), %rax     # 0x4078a
movq %rax, 0x20(%r12)
movq %r12, -0x8(%r13)
movq 0x40(%rsp), %rsi
incq %rsi
movq 0x30(%rsp), %rdi
jmp 0x149bb
callq 0x170f8
movl $0x1, 0x41881(%rip)     # 0x56434
pushq $0x1
popq %rdi
callq 0x1ac88
leaq 0xef6(%rip), %rdi       # 0x15ab8
callq 0x1aca1
leaq 0xfe4(%rip), %rdi       # 0x15bb2
callq 0x1aca9
leaq 0x1161(%rip), %rdi      # 0x15d3b
callq 0x1acb1
movq 0x3f3e2(%rip), %rax     # 0x53fc8
movq (%rax), %rdi
callq 0x10420
movl %eax, %edi
callq 0x100f0
testl %eax, %eax
je 0x14c27
leaq 0x2ba48(%rip), %rdi     # 0x40648
leaq 0x2ba53(%rip), %rsi     # 0x4065a
callq 0x11e90
movq %rax, %r14
testq %rax, %rax
sete %r15b
je 0x14c20
movq %r14, %rdi
callq 0x1c101
callq 0x11de0
jmp 0x14c2d
movb $0x1, %r15b
xorl %r14d, %r14d
callq 0x15497
leaq 0x2ba33(%rip), %r12     # 0x4066c
cmpq $0x0, 0x41917(%rip)     # 0x56558
leaq 0x41870(%rip), %rdi     # 0x564b8
cmoveq %r12, %rdi
callq 0x1b72f
testq %rax, %rax
je 0x14f5b
movq %rax, %r13
movb (%rax), %bl
testb %bl, %bl
je 0x14f14
cmpl $0x0, 0x418d2(%rip)     # 0x56540
je 0x14cf6
movq %r13, %rdi
leaq 0x2bb1c(%rip), %rsi     # 0x4079a
pushq $0x5
popq %rdx
callq 0x100c0
testl %eax, %eax
je 0x14c96
cmpb $0x65, %bl
jne 0x14cf6
cmpb $0x20, 0x1(%r13)
jne 0x14cf6
pushq $0x10
popq %rdi
callq 0x1a51a
movq %rax, %rbp
movl $0x2, 0xc(%rsp)
movq %r13, %rdi
callq 0x101c0
xorl %ecx, %ecx
cmpb $0x20, 0x1(%r13)
movq %rax, %rbx
setne %cl
leal (%rcx,%rcx,2), %r12d
leal (%rcx,%rcx,2), %esi
incl %esi
movq %r13, %rdi
callq 0x18d90
movq %rax, (%rbp)
leaq (%r12,%r13), %rdi
addq $0x2, %rdi
subl %r12d, %ebx
leaq 0x2b987(%rip), %r12     # 0x4066c
addl $-0x2, %ebx
movslq %ebx, %rsi
callq 0x18d90
movq %rax, 0x8(%rbp)
jmp 0x14d06
movq %r13, %rdi
leaq 0xc(%rsp), %rsi
callq 0x1a100
movq %rax, %rbp
testb %r15b, %r15b
jne 0x14d13
movq %r13, %rdi
callq 0x1bed6
testq %r14, %r14
je 0x14d20
movq %r14, %rdi
callq 0x1c075
testq %rbp, %rbp
je 0x14de8
movl 0xc(%rsp), %ebx
testl %ebx, %ebx
jle 0x14f08
movq (%rbp), %r12
movq %r12, %rdi
leaq 0x2b939(%rip), %rsi     # 0x4067c
callq 0x10080
testl %eax, %eax
je 0x14f5b
movq %r12, %rdi
leaq 0x2b927(%rip), %rsi     # 0x40681
callq 0x10080
testl %eax, %eax
je 0x14f5b
cmpb $0x3a, (%r12)
je 0x14f2b
movq %r12, %rdi
leaq 0x2b90a(%rip), %rsi     # 0x40686
callq 0x10080
testl %eax, %eax
je 0x14df9
cmpl $0x1, %ebx
je 0x14e21
cmpl $0x3, %ebx
jne 0x14e38
movq %r12, %rdi
leaq 0x2b917(%rip), %rsi     # 0x406b8
callq 0x10080
testl %eax, %eax
jne 0x14e38
movq 0x41653(%rip), %rdi     # 0x56408
callq 0x18f40
movq 0x8(%rbp), %rdi
callq 0x18ed2
movq %rax, 0x4163e(%rip)     # 0x56408
movq 0x10(%rbp), %rdi
callq 0x10600
movl %eax, 0x41637(%rip)     # 0x56410
callq 0x15497
pushq $0x1
popq %rdi
callq 0x1465e
jmp 0x14e15
leaq 0x2bf53(%rip), %rdi     # 0x40d42
callq 0x100e0
jmp 0x14f14
cmpq $0x0, 0x41737(%rip)     # 0x56538
jne 0x14f3d
leaq 0x2b880(%rip), %rdi     # 0x4068e
xorl %eax, %eax
callq 0x101f0
leaq 0x2b850(%rip), %r12     # 0x4066c
jmp 0x14f08
movq %r12, %rdi
leaq 0x2b895(%rip), %rsi     # 0x406c0
callq 0x10080
testl %eax, %eax
je 0x14f21
callq 0x15071
movq %rax, %rbx
movq (%rbp), %rdi
leaq 0x10(%rsp), %rsi
pushq $0xa
popq %rdx
callq 0x103f0
movl 0xc(%rsp), %edi
xorl %ecx, %ecx
cmpl $0x2, %edi
jl 0x14e78
movq 0x10(%rsp), %rdx
cmpb $0x0, (%rdx)
jne 0x14e78
movl %eax, %esi
pushq $0x1
popq %rdx
testq %rsi, %rsi
je 0x14e7b
movslq %eax, %rdx
pushq $0x1
popq %rcx
jmp 0x14e7b
pushq $0x1
popq %rdx
subl %ecx, %edi
movl %ecx, %eax
leaq (,%rax,8), %rsi
addq %rbp, %rsi
callq 0x15d40
cmpl $0x0, 0x416b2(%rip)     # 0x56548
leaq 0x2b7cf(%rip), %r12     # 0x4066c
je 0x14ed4
andl $0x0, 0x416a2(%rip)     # 0x56548
xorl %edi, %edi
callq 0x1524e
cmpl $0x0, 0x41690(%rip)     # 0x56544
leaq 0x2b325(%rip), %rsi     # 0x401e0
leaq 0x2b827(%rip), %rax     # 0x406e9
cmoveq %rax, %rsi
leaq 0x2b7f9(%rip), %rdi     # 0x406c6
xorl %eax, %eax
callq 0x101f0
callq 0x15071
subq %rbx, %rax
cmpq $0x1f4, %rax            # imm = 0x1F4
jl 0x14f08
cmpl $0x0, 0x415bd(%rip)     # 0x564a8
jne 0x14f08
cvtsi2sd %rax, %xmm0
divsd 0x262e6(%rip), %xmm0    # 0x3b1e0
leaq 0x2b808(%rip), %rdi     # 0x40709
movb $0x1, %al
callq 0x101f0
movl 0xc(%rsp), %esi
movq %rbp, %rdi
callq 0x19f36
movq %r13, %rdi
callq 0x1bed1
jmp 0x14c39
callq 0x1ac8f
jmp 0x14e15
movq %rbp, %rdi
movl %ebx, %esi
pushq $0x1
popq %rdx
callq 0x11d26
jmp 0x14c32
pushq $0x1
popq %rax
movl %eax, 0x415fa(%rip)     # 0x56540
movl %eax, 0x4155c(%rip)     # 0x564a8
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
callq 0x10630