// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %rbx
callq 0x4974
movzbl (%rbx), %eax
cmpl $0x20, %eax
jne 0x4b31
incq %rbx
jmp 0x4b24
cmpl $0x23, %eax
je 0x4cc3
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)
movq %rbx, %rdi
movl $0x3d, %ecx
callq 0x499a
cmpl $0x2, %eax
jne 0x4cd0
movabsq $0x615f6e657473696c, %rax # imm = 0x615F6E657473696C
xorq 0x80(%rsp), %rax
movabsq $0x73736572646461, %rcx # imm = 0x73736572646461
xorq 0x87(%rsp), %rcx
orq %rax, %rcx
je 0x4c27
leaq 0x3613(%rip), %rdi      # 0x81df
leaq 0x6e7d(%rip), %r14      # 0xba50
leaq 0x80(%rsp), %rbx
movq %rbx, %rsi
callq 0x32e0
testl %eax, %eax
je 0x4c4d
movq (%r14), %rdi
addq $0x10, %r14
testq %rdi, %rdi
jne 0x4bdb
leaq 0x3682(%rip), %rdi      # 0x827c
leaq 0x6ef7(%rip), %r14      # 0xbaf8
leaq 0x80(%rsp), %rbx
movq %rbx, %rsi
callq 0x32e0
testl %eax, %eax
je 0x4c6d
movq 0x8(%r14), %rdi
addq $0x10, %r14
testq %rdi, %rdi
jne 0x4c09
jmp 0x4cc3
leaq 0x76ea(%rip), %rbx      # 0xc318
cmpq $0x0, (%rbx)
je 0x4c40
leaq 0x76dd(%rip), %rdi      # 0xc318
callq 0x3040
movq %rsp, %rdi
callq 0x3510
movq %rax, (%rbx)
jmp 0x4cc3
cmpb $0x30, (%rsp)
jne 0x4c5d
movq %rsp, %rdi
callq 0x4a4f
jmp 0x4c65
movq %rsp, %rdi
callq 0x34c0
movq -0x8(%r14), %rcx
movl %eax, (%rcx)
jmp 0x4cc3
movl (%rsp), %eax
cmpw $0x31, %ax
je 0x4c84
cmpl $0x736579, %eax         # imm = 0x736579
je 0x4c84
cmpl $0x534559, %eax         # imm = 0x534559
jne 0x4c8d
movq (%r14), %rax
movl $0x1, (%rax)
movl $0x6f6e, %eax           # imm = 0x6F6E
xorl (%rsp), %eax
movzbl 0x2(%rsp), %ecx
orw %ax, %cx
je 0x4cba
movl (%rsp), %eax
movl %eax, %ecx
xorl $0x4f4e, %ecx           # imm = 0x4F4E
movzbl 0x2(%rsp), %edx
orw %cx, %dx
je 0x4cba
cmpw $0x30, %ax
jne 0x4cc3
movq (%r14), %rax
movl $0x0, (%rax)
xorl %eax, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
retq
movq 0x7321(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x34d2(%rip), %rsi      # 0x81b3
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3310
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4cc5
nop