// File: /workspace/github_cpp_makefile_star2_O1/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 $0x1848, %rsp           # imm = 0x1848
leaq 0x3362(%rip), %rsi      # 0x93c5
callq 0x2230
testq %rax, %rax
je 0x62d0
movq %rax, %rbx
movb $0x0, 0x820(%rsp)
movl $0x1, %edi
movl $0x20, %esi
callq 0x2150
movq %rax, %r14
movl $0x80, 0x4(%rax)
movl $0x80, %edi
movl $0x8, %esi
callq 0x2150
movq %rax, 0x8(%r14)
movl $0x80, %edi
movl $0x8, %esi
callq 0x2150
movq %rax, 0x10(%r14)
movl $0x80, %edi
movl $0x4, %esi
callq 0x2150
movq %rax, 0x18(%r14)
leaq 0x1440(%rsp), %r15
movq %r15, %rdi
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdx
callq 0x2300
testq %rax, %rax
je 0x62c6
movabsq $0x800000800000001, %r13 # imm = 0x800000800000001
movq %r15, %rcx
movq %rcx, %rbp
movsbl (%rcx), %r12d
movl %r12d, %edi
callq 0x2040
testl %r12d, %r12d
je 0x6118
leaq 0x1(%rbp), %rcx
testl %eax, %eax
jne 0x60fc
movzbl %r12b, %eax
cmpl $0x3b, %eax
ja 0x612d
movl %eax, %eax
btq %rax, %r13
jb 0x62aa
movq %rbp, %rdi
leaq 0x31b9(%rip), %rsi      # 0x92f0
leaq 0x820(%rsp), %r12
movq %r12, %rdx
xorl %eax, %eax
callq 0x21e0
cmpl $0x1, %eax
jne 0x618b
movq %r12, %rdi
callq 0x5c2d
movl $0x401, %edx            # imm = 0x401
movq %r12, %rdi
movq %rax, %rsi
callq 0x5844
movl $0x801, %edx            # imm = 0x801
leaq 0xc30(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
callq 0x5844
movq %r14, %rdi
movq %rbp, %rsi
xorl %edx, %edx
jmp 0x62a5
movq %rbp, %rdi
leaq 0x3162(%rip), %rsi      # 0x92f7
leaq 0x410(%rsp), %rdx
movq %rsp, %rcx
xorl %eax, %eax
callq 0x21e0
cmpl $0x2, %eax
je 0x61f2
movq %rbp, %rdi
leaq 0x3151(%rip), %rsi      # 0x9307
leaq 0x410(%rsp), %rdx
movq %rsp, %rcx
xorl %eax, %eax
callq 0x21e0
cmpl $0x2, %eax
je 0x61f2
movq %rbp, %rdi
leaq 0x3140(%rip), %rsi      # 0x9317
leaq 0x410(%rsp), %rdx
movq %rsp, %rcx
xorl %eax, %eax
callq 0x21e0
cmpl $0x2, %eax
jne 0x62aa
leaq 0x410(%rsp), %r12
movq %r12, %rdi
callq 0x62e8
movq %rax, %rdi
callq 0x5c2d
movl $0x401, %edx            # imm = 0x401
movq %r12, %rdi
movq %rax, %rsi
callq 0x5844
movl (%rsp), %eax
movl $0x2222, %ecx           # imm = 0x2222
xorl %ecx, %eax
movzbl 0x2(%rsp), %ecx
orw %ax, %cx
je 0x6267
movl (%rsp), %eax
movl $0x2727, %ecx           # imm = 0x2727
xorl %ecx, %eax
movzbl 0x2(%rsp), %ecx
orw %ax, %cx
je 0x6267
movq %rsp, %rbp
movq %rbp, %rdi
callq 0x62e8
movl $0x401, %edx            # imm = 0x401
movq %rbp, %rdi
movq %rax, %rsi
callq 0x5844
leaq 0x820(%rsp), %rcx
jmp 0x6276
movb $0x0, (%rsp)
leaq 0x820(%rsp), %rcx
movq %rsp, %rbp
movl $0x801, %esi            # imm = 0x801
leaq 0xc30(%rsp), %r12
movq %r12, %rdi
leaq 0x30b6(%rip), %rdx      # 0x9343
leaq 0x410(%rsp), %r8
xorl %eax, %eax
callq 0x2310
movq %r14, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x5d74
movq %r15, %rdi
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdx
callq 0x2300
movq %r15, %rcx
testq %rax, %rax
jne 0x60fc
movq %rbx, %rdi
callq 0x21f0
jmp 0x62d3
xorl %r14d, %r14d
movq %r14, %rax
addq $0x1848, %rsp           # imm = 0x1848
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq