// File: /workspace/github_c_makefile_star2_O2/icysunlight[P]miniftpd/parseconf.c
// Function: parseconf_load_setting
int parseconf_load_setting(char* line)
{
    str_trim_crlf(line);

    while (' ' == *line)
        line++;

    if ('#' == *line)
        return 0;

    char config_key[128] = {0};
    char config_val[128] = {0};

    if ( 2 != str_split(line,config_key,config_val,'='))
    {
        fprintf(stderr, "config synax error:%s\n",line);
        return -1;
    }

    struct conf_str_t* conf_str = conf_str_array;
    while (NULL != conf_str->conf_str_key) 
    {
        if (0 == strcmp(conf_str->conf_str_key,config_key))
        {
            if (NULL != *(conf_str->conf_str_val))
                free(conf_str->conf_str_val);

            *(conf_str->conf_str_val) = strdup(config_val);
            return 0;
        } 
        conf_str++;
    }

    //查找整数型配置
    struct conf_uint_t* conf_uint = conf_uint_array;
    while ( NULL != conf_uint->conf_uint_key)
    {
        if (0 == strcmp(conf_uint->conf_uint_key,config_key))
        {
            unsigned int nval = 0;
            if ( '0' == config_val[0])
                nval = str_octal_to_uint(config_val);
            else
                nval = atoi(config_val);

            *(conf_uint->conf_uint_val) = nval;
            return 0;
        }
        conf_uint++;
    }


    //查找bool型配置
    struct conf_bool_t* conf_bool = conf_bool_array;
    while ( NULL != conf_bool->conf_bool_key)
    {
        if (0 == strcmp(conf_bool->conf_bool_key,config_key))
        {
            if ( 0 == strcmp(config_val,"yes")
              || 0 == strcmp(config_val,"YES")   
              || 0 == strcmp(config_val,"1"))
                *(conf_bool->conf_bool_val) = 1;
            if ( 0 == strcmp(config_val,"no")
              || 0 == strcmp(config_val,"NO")   
              || 0 == strcmp(config_val,"0"))
                *(conf_bool->conf_bool_val) = 0;

            return 0;
        }
        conf_bool++;
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rdi, %rbx
callq 0x450c
movzbl (%rbx), %eax
cmpl $0x20, %eax
jne 0x46e2
incq %rbx
jmp 0x46d5
cmpl $0x23, %eax
je 0x4868
xorps %xmm0, %xmm0
leaq 0x80(%rsp), %rsi
movaps %xmm0, 0x70(%rsi)
movaps %xmm0, 0x60(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movq %rsp, %rdx
movaps %xmm0, 0x70(%rdx)
movaps %xmm0, 0x60(%rdx)
movaps %xmm0, 0x50(%rdx)
movaps %xmm0, 0x40(%rdx)
movaps %xmm0, 0x30(%rdx)
movaps %xmm0, 0x20(%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, (%rdx)
pushq $0x3d
popq %rcx
movq %rbx, %rdi
callq 0x4532
cmpl $0x2, %eax
jne 0x4879
leaq 0x62d6(%rip), %r14      # 0xaa28
leaq 0x80(%rsp), %rbx
movq -0x8(%r14), %rdi
testq %rdi, %rdi
je 0x4775
movq %rbx, %rsi
callq 0x32e0
testl %eax, %eax
je 0x479f
addq $0x10, %r14
jmp 0x475a
leaq 0x62cc(%rip), %r14      # 0xaa48
leaq 0x80(%rsp), %rbx
movq -0x8(%r14), %rdi
testq %rdi, %rdi
je 0x47c0
movq %rbx, %rsi
callq 0x32e0
testl %eax, %eax
je 0x47f0
addq $0x10, %r14
jmp 0x4784
movq (%r14), %rbx
cmpq $0x0, (%rbx)
je 0x47b0
movq %rbx, %rdi
callq 0x3040
movq %rsp, %rdi
callq 0x3510
movq %rax, (%rbx)
jmp 0x4868
leaq 0x6331(%rip), %r15      # 0xaaf8
leaq 0x80(%rsp), %r14
xorl %ebx, %ebx
movq -0x8(%r15), %rdi
testq %rdi, %rdi
je 0x486a
movq %r14, %rsi
callq 0x32e0
testl %eax, %eax
je 0x4800
addq $0x10, %r15
jmp 0x47d1
cmpb $0x30, (%rsp)
jne 0x485b
movq %rsp, %rdi
callq 0x45d8
jmp 0x4863
movl (%rsp), %eax
cmpw $0x31, %ax
je 0x4817
cmpl $0x736579, %eax         # imm = 0x736579
je 0x4817
cmpl $0x534559, %eax         # imm = 0x534559
jne 0x4820
movq (%r15), %rax
movl $0x1, (%rax)
leaq 0x29a3(%rip), %rsi      # 0x71ca
movq %rsp, %rdi
pushq $0x3
popq %rdx
callq 0x33d0
testl %eax, %eax
je 0x4853
leaq 0x2990(%rip), %rsi      # 0x71cd
movq %rsp, %rdi
pushq $0x3
popq %rdx
callq 0x33d0
testl %eax, %eax
je 0x4853
cmpw $0x30, (%rsp)
jne 0x486a
movq (%r15), %rax
andl $0x0, (%rax)
jmp 0x486a
movq %rsp, %rdi
callq 0x34c0
movq (%r14), %rcx
movl %eax, (%rcx)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %r15
retq
movq 0x6778(%rip), %rax      # 0xaff8
movq (%rax), %rdi
leaq 0x2929(%rip), %rsi      # 0x71b3
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3310
pushq $-0x1
popq %rbx
jmp 0x486a
nopl (%rax)