// File: 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
movq %rsp, %rbp
subq $0x1080, %rsp           # imm = 0x1080
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x3f7d(%rip), %rsi      # 0xc3f7
callq 0x2250
movq %rax, -0x1060(%rbp)
cmpq $0x0, %rax
jne 0x8499
movq $0x0, -0x8(%rbp)
jmp 0x86e7
movb $0x0, -0x830(%rbp)
xorl %edi, %edi
callq 0x8700
movq %rax, -0x18(%rbp)
movl $0x0, -0x1064(%rbp)
leaq -0x420(%rbp), %rdi
movq -0x1060(%rbp), %rdx
movl $0x400, %esi            # imm = 0x400
callq 0x2310
cmpq $0x0, %rax
je 0x86d3
movl -0x1064(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1064(%rbp)
leaq -0x420(%rbp), %rdi
callq 0x8790
movq %rax, -0x1058(%rbp)
movq -0x1058(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3b, %eax
je 0x8526
movq -0x1058(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
je 0x8526
movq -0x1058(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x8528
jmp 0x84b5
movq -0x1058(%rbp), %rdi
leaq -0x830(%rbp), %rdx
leaq 0x3de5(%rip), %rsi      # 0xc322
movb $0x0, %al
callq 0x2200
cmpl $0x1, %eax
jne 0x8593
leaq -0x830(%rbp), %rax
movq %rax, -0x1070(%rbp)
leaq -0x830(%rbp), %rdi
callq 0x7d00
movq -0x1070(%rbp), %rdi
movq %rax, %rsi
movl $0x401, %edx            # imm = 0x401
callq 0x76d0
movq -0x18(%rbp), %rdi
leaq -0x830(%rbp), %rsi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rdx
callq 0x8810
jmp 0x86cc
movq -0x1058(%rbp), %rdi
leaq -0xc40(%rbp), %rdx
leaq -0x1050(%rbp), %rcx
leaq 0x3d7a(%rip), %rsi      # 0xc329
movb $0x0, %al
callq 0x2200
cmpl $0x2, %eax
je 0x860f
movq -0x1058(%rbp), %rdi
leaq -0xc40(%rbp), %rdx
leaq -0x1050(%rbp), %rcx
leaq 0x3d62(%rip), %rsi      # 0xc339
movb $0x0, %al
callq 0x2200
cmpl $0x2, %eax
je 0x860f
movq -0x1058(%rbp), %rdi
leaq -0xc40(%rbp), %rdx
leaq -0x1050(%rbp), %rcx
leaq 0x3d4a(%rip), %rsi      # 0xc349
movb $0x0, %al
callq 0x2200
cmpl $0x2, %eax
jne 0x86ca
leaq -0xc40(%rbp), %rax
movq %rax, -0x1078(%rbp)
leaq -0xc40(%rbp), %rdi
callq 0x8890
movq %rax, %rdi
callq 0x7d00
movq -0x1078(%rbp), %rdi
movq %rax, %rsi
movl $0x401, %edx            # imm = 0x401
callq 0x76d0
leaq -0x1050(%rbp), %rdi
leaq 0x3d05(%rip), %rsi      # 0xc358
callq 0x22b0
cmpl $0x0, %eax
je 0x8675
leaq -0x1050(%rbp), %rdi
leaq 0x3cf0(%rip), %rsi      # 0xc35b
callq 0x22b0
cmpl $0x0, %eax
jne 0x867e
movb $0x0, -0x1050(%rbp)
jmp 0x86ac
leaq -0x1050(%rbp), %rax
movq %rax, -0x1080(%rbp)
leaq -0x1050(%rbp), %rdi
callq 0x8890
movq -0x1080(%rbp), %rdi
movq %rax, %rsi
movl $0x401, %edx            # imm = 0x401
callq 0x76d0
movq -0x18(%rbp), %rdi
leaq -0x830(%rbp), %rsi
leaq -0xc40(%rbp), %rdx
leaq -0x1050(%rbp), %rcx
callq 0x8810
jmp 0x86cc
jmp 0x86ce
jmp 0x84b5
movq -0x1060(%rbp), %rdi
callq 0x2210
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x1080, %rsp           # imm = 0x1080
popq %rbp
retq
nopw %cs:(%rax,%rax)