// File: /workspace/github_c_makefile_star2_O2/Matthias-Wandel[P]imgcomp/src/config.c
// Function: read_config_file
void read_config_file(char *config_file)
{
    FILE * file;
    char ConfLine[201];
    int linenum = 0;

    file = fopen(config_file, "r");
    if (file == NULL){
        fprintf(stderr, "No configuration file %s\n",config_file);
        return;
    }
    for(;;){
        char *s, *value, *t;
        int len, a;
        s = fgets(ConfLine, sizeof(ConfLine)-1, file);
        ConfLine[sizeof(ConfLine)-1] = '\0';
        if (s == NULL) break;
        linenum += 1;

        // Remove leading spaces
        while (*s == ' ' || *s == '\t') s++;

        // Check line length not exceeded.
        len = strlen(s);
        if(len >= sizeof(ConfLine)-1){
            fprintf(stderr, "Configuration line too long:\n%s",s);
            goto no_good;
        }

        // Remove trailing spaces and linefeed.
        t = s+len-1;
        while (*t <= ' ' && t > s) *t-- = '\0';

        if (*s == '#') continue; // comment.
        if (*s == '\r' || *s == '\n') continue; // Blank line.

        value = strstr(s, "=");
        if (value != NULL){
            t = value;

            // Remove value leading spaces
            value += 1;
            while (*value == ' ' || *value == '\t') value++;

            // remove tag trailing spaces.
            *t = '\0';
            t--;
            while (*t == ' ' || *t == '\t'){
                *t = '\0';
                t--;
            }
        }
        
        {
            static int msg_shown = 0;
            if (!msg_shown) printf("Configuration parameters:\n");
            msg_shown = 1;
        }

        // Now finally have the tag extracted.
        printf("    '%s' = '%s'\n",s, value);

        a = parse_parameter(s,value);
        if (a < 0){
no_good:            
            fprintf(stderr, "Error on line %d of imgcomp.conf\n",linenum);
            exit(-1);
        }

    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x8474(%rip), %rsi      # 0xd7b1
callq 0x3440
testq %rax, %rax
je 0x5475
movq %rax, %r14
movq %rsp, %r15
movabsq $0x800002400, %r12      # imm = 0x800002400
xorl %ebx, %ebx
movq %r15, %rdi
movl $0xc8, %esi
movq %r14, %rdx
callq 0x3220
movb $0x0, 0xc8(%rsp)
testq %rax, %rax
je 0x5463
movq %rax, %r13
movq %rax, %rbp
decq %rbp
movzbl (%r13), %eax
cmpl $0x20, %eax
je 0x5396
cmpl $0x9, %eax
jne 0x539e
incq %r13
incq %rbp
jmp 0x5387
incl %ebx
movq %r13, %rdi
callq 0x3130
cltq
cmpq $0xc8, %rax
jae 0x54a1
addq %rax, %rbp
cmpb $0x20, (%rbp)
jg 0x53cd
cmpq %r13, %rbp
jbe 0x53cd
movb $0x0, (%rbp)
decq %rbp
jmp 0x53b9
movzbl (%r13), %eax
cmpq $0x23, %rax
ja 0x53e2
btq %rax, %r12
jb 0x535d
movq %r13, %rdi
pushq $0x3d
popq %rsi
callq 0x3160
testq %rax, %rax
je 0x541c
movq %rax, %rbp
incq %rbp
movzbl (%rbp), %ecx
cmpl $0x9, %ecx
je 0x53f5
cmpl $0x20, %ecx
je 0x53f5
movb $0x0, (%rax)
movzbl -0x1(%rax), %ecx
decq %rax
cmpl $0x9, %ecx
je 0x5406
cmpl $0x20, %ecx
je 0x5406
jmp 0x541e
xorl %ebp, %ebp
cmpb $0x0, 0xd593(%rip)      # 0x129b8
jne 0x5433
leaq 0x72ad(%rip), %rdi      # 0xc6db
callq 0x30c0
movb $0x1, 0xd57e(%rip)      # 0x129b8
leaq 0x6e9f(%rip), %rdi      # 0xc2e0
movq %r13, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x3170
movq %r13, %rdi
movq %rbp, %rsi
callq 0x4a02
testl %eax, %eax
jns 0x535d
jmp 0x54bc
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xcb7c(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
leaq 0x6e20(%rip), %rsi      # 0xc2a6
movq %rbx, %rdx
xorl %eax, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x32a0
movq 0xcb50(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
leaq 0x6e0e(%rip), %rsi      # 0xc2c0
movq %r13, %rdx
xorl %eax, %eax
callq 0x32a0
movq 0xcb35(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
leaq 0x6e24(%rip), %rsi      # 0xc2f1
movl %ebx, %edx
xorl %eax, %eax
callq 0x32a0
pushq $-0x1
popq %rdi
callq 0x34a0