// File: /workspace/github_cpp_makefile_star2_O2/qian-jiahong[P]uvncrep017-ws/iniparser.cpp
// Function: iniparser_new
dictionary * iniparser_new(char *ininame)
{
    dictionary  *   d ;
    char        lin[ASCIILINESZ+1];
    char        sec[ASCIILINESZ+1];
    char        key[ASCIILINESZ+1];
    char        val[ASCIILINESZ+1];
    char    *   where ;
    FILE    *   ini ;
    int         lineno ;

    if ((ini=fopen(ininame, "r"))==NULL) {
        return NULL ;
    }

    sec[0]=0;

    /*
     * Initialize a new dictionary entry
     */
    d = dictionary_new(0);
    lineno = 0 ;
    while (fgets(lin, ASCIILINESZ, ini)!=NULL) {
        lineno++ ;
        where = strskp(lin); /* Skip leading spaces */
        if (*where==';' || *where=='#' || *where==0)
            continue ; /* Comment lines */
        else {
            if (sscanf(where, "[%[^]]", sec)==1) {
                /* Valid section name */
                strlcpy(sec, strlwc(sec), ASCIILINESZ+1);
                iniparser_add_entry(d, sec, NULL, NULL);
            } else if (sscanf (where, "%[^=] = \"%[^\"]\"", key, val) == 2
                   ||  sscanf (where, "%[^=] = '%[^\']'",   key, val) == 2
                   ||  sscanf (where, "%[^=] = %[^;#]",     key, val) == 2) {
                strlcpy(key, strlwc(strcrop(key)), ASCIILINESZ+1);
                /*
                 * sscanf cannot handle "" or '' as empty value,
                 * this is done here
                 */
                if (!strcmp(val, "\"\"") || !strcmp(val, "''")) {
                    val[0] = (char)0;
                } else {
                    strlcpy(val, strcrop(val), ASCIILINESZ+1);
                }
                iniparser_add_entry(d, sec, key, val);
            }
        }
    }
    fclose(ini);
    return d ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1048, %rsp           # imm = 0x1048
leaq 0x377a(%rip), %rsi      # 0x93c5
callq 0x2240
testq %rax, %rax
je 0x5e80
movq %rax, %rbx
leaq 0x830(%rsp), %rax
movb $0x0, (%rax)
pushq $0x1
popq %rdi
pushq $0x20
popq %rsi
callq 0x2150
movq %rax, %r14
movl $0x80, 0x4(%rax)
pushq $0x8
popq %r12
movl $0x80, %edi
movq %r12, %rsi
callq 0x2150
movq %rax, 0x8(%r14)
movl $0x80, %edi
movq %r12, %rsi
callq 0x2150
movq %rax, 0x10(%r14)
pushq $0x4
popq %rsi
movl $0x80, %edi
callq 0x2150
movq %r14, 0x8(%rsp)
movq %rax, 0x18(%r14)
leaq 0xc3f(%rsp), %r15
leaq 0xc40(%rsp), %r12
movabsq $0x800000800000001, %r14 # imm = 0x800000800000001
movq %r12, %rdi
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdx
callq 0x2310
testq %rax, %rax
je 0x5e71
movq %r15, %rbp
movsbl 0x1(%rbp), %r13d
incq %rbp
movl %r13d, %edi
callq 0x2040
testl %r13d, %r13d
je 0x5d07
testl %eax, %eax
jne 0x5cee
movzbl %r13b, %eax
cmpl $0x3b, %eax
ja 0x5d18
movl %eax, %eax
btq %rax, %r14
jb 0x5cd2
movq %rbp, %rdi
leaq 0x35ce(%rip), %rsi      # 0x92f0
leaq 0x830(%rsp), %r13
movq %r13, %rdx
xorl %eax, %eax
callq 0x21e0
cmpl $0x1, %eax
jne 0x5d67
movq %r13, %rdi
callq 0x5902
movl $0x401, %edx            # imm = 0x401
movq %r13, %rdi
movq %rax, %rsi
callq 0x553a
movq 0x8(%rsp), %rdi
movq %r13, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x5e94
jmp 0x5cd2
movq %rbp, %rdi
leaq 0x3586(%rip), %rsi      # 0x92f7
leaq 0x420(%rsp), %rdx
leaq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0x21e0
cmpl $0x2, %eax
je 0x5dd4
movq %rbp, %rdi
leaq 0x3573(%rip), %rsi      # 0x9307
leaq 0x420(%rsp), %rdx
leaq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0x21e0
cmpl $0x2, %eax
je 0x5dd4
movq %rbp, %rdi
leaq 0x3560(%rip), %rsi      # 0x9317
leaq 0x420(%rsp), %rdx
leaq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0x21e0
cmpl $0x2, %eax
jne 0x5cd2
leaq 0x420(%rsp), %r13
movq %r13, %rdi
callq 0x5ef0
movq %rax, %rdi
callq 0x5902
movl $0x401, %edx            # imm = 0x401
movq %r13, %rdi
movq %rax, %rsi
callq 0x553a
leaq 0x10(%rsp), %r13
movq %r13, %rdi
leaq 0x351b(%rip), %rsi      # 0x9326
pushq $0x3
popq %rbp
movq %rbp, %rdx
callq 0x2210
testl %eax, %eax
je 0x5e4a
movq %r13, %rdi
leaq 0x3505(%rip), %rsi      # 0x9329
movq %rbp, %rdx
callq 0x2210
testl %eax, %eax
je 0x5e4a
movq %r13, %rdi
callq 0x5ef0
movl $0x401, %edx            # imm = 0x401
movq %r13, %rdi
movq %rax, %rsi
callq 0x553a
jmp 0x5e4f
movb $0x0, 0x10(%rsp)
leaq 0x830(%rsp), %rsi
movq 0x8(%rsp), %rdi
leaq 0x420(%rsp), %rdx
movq %r13, %rcx
callq 0x5e94
jmp 0x5cd2
movq %rbx, %rdi
callq 0x21f0
movq 0x8(%rsp), %rax
jmp 0x5e82
xorl %eax, %eax
addq $0x1048, %rsp           # imm = 0x1048
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq