// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movl $0x0, -0xe4(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xacfa(%rip), %rsi      # 0x10aee
callq 0x3420
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x5e25
movq 0xe1e5(%rip), %rax      # 0x13ff0
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x9469(%rip), %rsi      # 0xf282
movb $0x0, %al
callq 0x3290
jmp 0x6136
jmp 0x5e27
leaq -0xe0(%rbp), %rdi
movq -0x10(%rbp), %rdx
movl $0xc8, %esi
callq 0x3220
movq %rax, -0xf0(%rbp)
movb $0x0, -0x18(%rbp)
cmpq $0x0, -0xf0(%rbp)
jne 0x5e56
jmp 0x6136
movl -0xe4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe4(%rbp)
movq -0xf0(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x109(%rbp)
je 0x5e92
movq -0xf0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x9, %eax
sete %al
movb %al, -0x109(%rbp)
movb -0x109(%rbp), %al
testb $0x1, %al
jne 0x5e9e
jmp 0x5eb2
movq -0xf0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xf0(%rbp)
jmp 0x5e65
movq -0xf0(%rbp), %rdi
callq 0x3130
movl %eax, -0x104(%rbp)
movslq -0x104(%rbp), %rax
cmpq $0xc8, %rax
jb 0x5ef7
movq 0xe116(%rip), %rax      # 0x13ff0
movq (%rax), %rdi
movq -0xf0(%rbp), %rdx
leaq 0x93b1(%rip), %rsi      # 0xf29c
movb $0x0, %al
callq 0x3290
jmp 0x6109
movq -0xf0(%rbp), %rax
movslq -0x104(%rbp), %rcx
addq %rcx, %rax
addq $-0x1, %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x20, %ecx
movb %al, -0x10a(%rbp)
jg 0x5f41
movq -0x100(%rbp), %rax
cmpq -0xf0(%rbp), %rax
seta %al
movb %al, -0x10a(%rbp)
movb -0x10a(%rbp), %al
testb $0x1, %al
jne 0x5f4d
jmp 0x5f67
movq -0x100(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x100(%rbp)
movb $0x0, (%rax)
jmp 0x5f13
movq -0xf0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x5f7b
jmp 0x5e27
movq -0xf0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xd, %eax
je 0x5f99
movq -0xf0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
jne 0x5f9e
jmp 0x5e27
movq -0xf0(%rbp), %rdi
leaq 0x9310(%rip), %rsi      # 0xf2bc
callq 0x34f0
movq %rax, -0xf8(%rbp)
cmpq $0x0, -0xf8(%rbp)
je 0x60a8
movq -0xf8(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0xf8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xf8(%rbp)
movq -0xf8(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x10b(%rbp)
je 0x6013
movq -0xf8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x9, %eax
sete %al
movb %al, -0x10b(%rbp)
movb -0x10b(%rbp), %al
testb $0x1, %al
jne 0x601f
jmp 0x6033
movq -0xf8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xf8(%rbp)
jmp 0x5fe6
movq -0x100(%rbp), %rax
movb $0x0, (%rax)
movq -0x100(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x10c(%rbp)
je 0x607c
movq -0x100(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x9, %eax
sete %al
movb %al, -0x10c(%rbp)
movb -0x10c(%rbp), %al
testb $0x1, %al
jne 0x6088
jmp 0x60a6
movq -0x100(%rbp), %rax
movb $0x0, (%rax)
movq -0x100(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x100(%rbp)
jmp 0x604f
jmp 0x60a8
cmpl $0x0, 0xe959(%rip)      # 0x14a08
jne 0x60bf
leaq 0x9206(%rip), %rdi      # 0xf2be
movb $0x0, %al
callq 0x3170
movl $0x1, 0xe93f(%rip)      # 0x14a08
movq -0xf0(%rbp), %rsi
movq -0xf8(%rbp), %rdx
leaq 0x91fb(%rip), %rdi      # 0xf2d9
movb $0x0, %al
callq 0x3170
movq -0xf0(%rbp), %rdi
movq -0xf8(%rbp), %rsi
callq 0x5040
movl %eax, -0x108(%rbp)
cmpl $0x0, -0x108(%rbp)
jge 0x6131
jmp 0x6109
movq 0xdee0(%rip), %rax      # 0x13ff0
movq (%rax), %rdi
movl -0xe4(%rbp), %edx
leaq 0x91ca(%rip), %rsi      # 0xf2ea
movb $0x0, %al
callq 0x3290
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3480
jmp 0x5e27
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nop