// File: /workspace/github_c_makefile_star2_O1/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 0x49cc
movzbl (%rbx), %eax
cmpl $0x20, %eax
jne 0x4b89
incq %rbx
jmp 0x4b7c
cmpl $0x23, %eax
je 0x4d1c
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 0x49f2
cmpl $0x2, %eax
jne 0x4d29
movabsq $0x615f6e657473696c, %rax # imm = 0x615F6E657473696C
xorq 0x80(%rsp), %rax
movabsq $0x73736572646461, %rcx # imm = 0x73736572646461
xorq 0x87(%rsp), %rcx
orq %rax, %rcx
je 0x4c7f
leaq 0x35bb(%rip), %rdi      # 0x81df
leaq 0x6e25(%rip), %r14      # 0xba50
leaq 0x80(%rsp), %rbx
movq %rbx, %rsi
callq 0x32d0
testl %eax, %eax
je 0x4ca5
movq (%r14), %rdi
addq $0x10, %r14
testq %rdi, %rdi
jne 0x4c33
leaq 0x362a(%rip), %rdi      # 0x827c
leaq 0x6e9f(%rip), %r14      # 0xbaf8
leaq 0x80(%rsp), %rbx
movq %rbx, %rsi
callq 0x32d0
testl %eax, %eax
je 0x4cc5
movq 0x8(%r14), %rdi
addq $0x10, %r14
testq %rdi, %rdi
jne 0x4c61
jmp 0x4d1c
leaq 0x7682(%rip), %rbx      # 0xc308
cmpq $0x0, (%rbx)
je 0x4c98
leaq 0x7675(%rip), %rdi      # 0xc308
callq 0x3040
movq %rsp, %rdi
callq 0x3500
movq %rax, (%rbx)
jmp 0x4d1c
cmpb $0x30, (%rsp)
jne 0x4cb5
movq %rsp, %rdi
callq 0x4aa7
jmp 0x4cbd
movq %rsp, %rdi
callq 0x34b0
movq -0x8(%r14), %rcx
movl %eax, (%rcx)
jmp 0x4d1c
cmpw $0x31, (%rsp)
je 0x4cdd
movl (%rsp), %eax
cmpl $0x736579, %eax         # imm = 0x736579
je 0x4cdd
cmpl $0x534559, %eax         # imm = 0x534559
jne 0x4ce6
movq (%r14), %rax
movl $0x1, (%rax)
movl $0x6f6e, %eax           # imm = 0x6F6E
xorl (%rsp), %eax
movzbl 0x2(%rsp), %ecx
orw %ax, %cx
je 0x4d13
movl (%rsp), %eax
movl %eax, %ecx
xorl $0x4f4e, %ecx           # imm = 0x4F4E
movzbl 0x2(%rsp), %edx
orw %cx, %dx
je 0x4d13
cmpw $0x30, %ax
jne 0x4d1c
movq (%r14), %rax
movl $0x0, (%rax)
xorl %eax, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
retq
movq 0x72c8(%rip), %rax      # 0xbff8
movq (%rax), %rdi
leaq 0x3479(%rip), %rsi      # 0x81b3
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3300
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4d1e
nop