// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/config.c
// Function: rewriteConfigReadOldFile
struct rewriteConfigState *rewriteConfigReadOldFile(char *path) {
    FILE *fp = fopen(path,"r");
    struct rewriteConfigState *state = zmalloc(sizeof(*state));
    char buf[CONFIG_MAX_LINE+1];
    int linenum = -1;

    if (fp == NULL && errno != ENOENT) return NULL;

    state->option_to_line = dictCreate(&optionToLineDictType,NULL);
    state->rewritten = dictCreate(&optionSetDictType,NULL);
    state->numlines = 0;
    state->lines = NULL;
    state->has_tail = 0;
    if (fp == NULL) return state;

    /* Read the old file line by line, populate the state. */
    while(fgets(buf,CONFIG_MAX_LINE+1,fp) != NULL) {
        int argc;
        sds *argv;
        sds line = sdstrim(sdsnew(buf),"\r\n\t ");

        linenum++; /* Zero based, so we init at -1 */

        /* Handle comments and empty lines. */
        if (line[0] == '#' || line[0] == '\0') {
            if (!state->has_tail && !strcmp(line,REDIS_CONFIG_REWRITE_SIGNATURE))
                state->has_tail = 1;
            rewriteConfigAppendLine(state,line);
            continue;
        }

        /* Not a comment, split into arguments. */
        argv = sdssplitargs(line,&argc);
        if (argv == NULL) {
            /* Apparently the line is unparsable for some reason, for
             * instance it may have unbalanced quotes. Load it as a
             * comment. */
            sds aux = sdsnew("# ??? ");
            aux = sdscatsds(aux,line);
            sdsfree(line);
            rewriteConfigAppendLine(state,aux);
            continue;
        }

        sdstolower(argv[0]); /* We only want lowercase config directives. */

        /* Now we populate the state according to the content of this line.
         * Append the line and populate the option -> line numbers map. */
        rewriteConfigAppendLine(state,line);
        rewriteConfigAddLineNumberToOption(state,argv[0],linenum);

        sdsfreesplitres(argv,argc);
    }
    fclose(fp);
    return state;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x450, %rsp            # imm = 0x450
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xcbf7f(%rip), %rsi     # 0x13a7c9
callq 0x26ae0
movq %rax, -0x18(%rbp)
movl $0x28, %edi
callq 0x3acd0
movq %rax, -0x20(%rbp)
movl $0xffffffff, -0x434(%rbp) # imm = 0xFFFFFFFF
cmpq $0x0, -0x18(%rbp)
jne 0x6e889
callq 0x26880
cmpl $0x2, (%rax)
je 0x6e889
movq $0x0, -0x8(%rbp)
jmp 0x6ea78
leaq 0x1089b8(%rip), %rdi    # 0x177248
xorl %eax, %eax
movl %eax, %esi
callq 0x2d330
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
leaq 0x1089ce(%rip), %rdi    # 0x177278
xorl %eax, %eax
movl %eax, %esi
callq 0x2d330
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x20(%rax)
cmpq $0x0, -0x18(%rbp)
jne 0x6e8f4
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x6ea78
jmp 0x6e8f6
leaq -0x430(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x401, %esi            # imm = 0x401
callq 0x26440
cmpq $0x0, %rax
je 0x6ea67
leaq -0x430(%rbp), %rdi
callq 0x38510
movq %rax, %rdi
leaq 0xd081b(%rip), %rsi     # 0x13f146
callq 0x39c80
movq %rax, -0x448(%rbp)
movl -0x434(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x434(%rbp)
movq -0x448(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
je 0x6e964
movq -0x448(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x6e9a6
movq -0x20(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jne 0x6e991
movq -0x448(%rbp), %rdi
leaq 0xd07cf(%rip), %rsi     # 0x13f14b
callq 0x268f0
cmpl $0x0, %eax
jne 0x6e991
movq -0x20(%rbp), %rax
movl $0x1, 0x20(%rax)
movq -0x20(%rbp), %rdi
movq -0x448(%rbp), %rsi
callq 0x6e700
jmp 0x6e8f6
movq -0x448(%rbp), %rdi
leaq -0x438(%rbp), %rsi
callq 0x3a5f0
movq %rax, -0x440(%rbp)
cmpq $0x0, -0x440(%rbp)
jne 0x6ea18
leaq 0xd0798(%rip), %rdi     # 0x13f169
callq 0x38510
movq %rax, -0x450(%rbp)
movq -0x450(%rbp), %rdi
movq -0x448(%rbp), %rsi
callq 0x39110
movq %rax, -0x450(%rbp)
movq -0x448(%rbp), %rdi
callq 0x38620
movq -0x20(%rbp), %rdi
movq -0x450(%rbp), %rsi
callq 0x6e700
jmp 0x6e8f6
movq -0x440(%rbp), %rax
movq (%rax), %rdi
callq 0x39ef0
movq -0x20(%rbp), %rdi
movq -0x448(%rbp), %rsi
callq 0x6e700
movq -0x20(%rbp), %rdi
movq -0x440(%rbp), %rax
movq (%rax), %rsi
movl -0x434(%rbp), %edx
callq 0x6e770
movq -0x440(%rbp), %rdi
movl -0x438(%rbp), %esi
callq 0x3a270
jmp 0x6e8f6
movq -0x18(%rbp), %rdi
callq 0x26a10
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x450, %rsp            # imm = 0x450
popq %rbp
retq
nopw %cs:(%rax,%rax)