// File: /workspace/github_c_makefile_star2_O0/ttoobne[P]bohttpd/src/core/config.c
// Function: check_name_value
static int check_name_value(config_t* config, char* name_st, char* name_ed, char* value_st, char* value_ed) {
    long ret;

    if (config == NULL || name_st == NULL || name_ed == NULL || value_st == NULL || value_ed == NULL) {
        return -1;
    }

    *(name_ed + 1) = '\0';
    *(value_ed + 1) = '\0';

    switch (name_ed - name_st + 1) {
    case 4:
        if (strncmp("root", name_st, name_ed - name_st + 1) == 0) {
            strncpy(config->root, value_st, sizeof(config->root));
            return 0;
        }
        
        if (strncmp("port", name_st, name_ed - name_st + 1) == 0) {
            if ((ret = (to_interger(value_st, value_ed))) < 0) {
                return -1;
            }

            if (ret > USHORT_MAX) {
                return -1;
            }

            config->port = ret;
            return 0;
        }

        break;
    
    case 6:
        if (strncmp("defile", name_st, name_ed - name_st + 1) == 0) {
            strncpy(config->defile, value_st, sizeof(config->defile));
            return 0;
        }

        break;

    case 7:
        if (strncmp("timeout", name_st, name_ed - name_st + 1) == 0) {
            if ((ret = (to_interger(value_st, value_ed))) < 0) {
                return -1;
            }

            config->timeout = ret;
            return 0;
        }

        break;

    case 9:
        if (strncmp("taskqueue", name_st, name_ed - name_st + 1) == 0) {
            if ((ret = (to_interger(value_st, value_ed))) < 0) {
                return -1;
            }

            if (ret > INT_MAX) {
                return -1;
            }

            config->taskqueue = ret;
            return 0;
        }

        break;

    case 10:
        if (strncmp("threadpool", name_st, name_ed - name_st + 1) == 0) {
            if ((ret = (to_interger(value_st, value_ed))) < 0) {
                return -1;
            }

            if (ret > INT_MAX) {
                return -1;
            }

            config->threadpool = ret;
            return 0;
        }

        break;
        
    default:
        break;
    }

    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x335f
cmpq $0x0, -0x18(%rbp)
je 0x335f
cmpq $0x0, -0x20(%rbp)
je 0x335f
cmpq $0x0, -0x28(%rbp)
je 0x335f
cmpq $0x0, -0x30(%rbp)
jne 0x336b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3613
movq -0x20(%rbp), %rax
movb $0x0, 0x1(%rax)
movq -0x30(%rbp), %rax
movb $0x0, 0x1(%rax)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
subq %rcx, %rax
addq $-0x3, %rax
movq %rax, -0x40(%rbp)
subq $0x6, %rax
ja 0x360a
movq -0x40(%rbp), %rax
leaq 0x5f39(%rip), %rcx      # 0x92dc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rax
subq %rax, %rdx
addq $0x1, %rdx
leaq 0x60a0(%rip), %rdi      # 0x9466
callq 0x2070
cmpl $0x0, %eax
jne 0x33f2
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movq -0x28(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x2060
movl $0x0, -0x4(%rbp)
jmp 0x3613
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rax
subq %rax, %rdx
addq $0x1, %rdx
leaq 0x605f(%rip), %rdi      # 0x946b
callq 0x2070
cmpl $0x0, %eax
jne 0x346d
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x3650
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jge 0x3439
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3613
cmpq $0xffff, -0x38(%rbp)    # imm = 0xFFFF
jle 0x344f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3613
movq -0x38(%rbp), %rax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0x210(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x3613
jmp 0x360c
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rax
subq %rax, %rdx
addq $0x1, %rdx
leaq 0x5fe4(%rip), %rdi      # 0x9470
callq 0x2070
cmpl $0x0, %eax
jne 0x34bb
movq -0x10(%rbp), %rdi
addq $0x108, %rdi            # imm = 0x108
movq -0x28(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x2060
movl $0x0, -0x4(%rbp)
jmp 0x3613
jmp 0x360c
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rax
subq %rax, %rdx
addq $0x1, %rdx
leaq 0x5f9d(%rip), %rdi      # 0x9477
callq 0x2070
cmpl $0x0, %eax
jne 0x3522
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x3650
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jge 0x3507
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3613
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x208(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x3613
jmp 0x360c
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rax
subq %rax, %rdx
addq $0x1, %rdx
leaq 0x5f3e(%rip), %rdi      # 0x947f
callq 0x2070
cmpl $0x0, %eax
jne 0x359a
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x3650
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jge 0x356e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3613
cmpq $0x7fffffff, -0x38(%rbp) # imm = 0x7FFFFFFF
jle 0x3584
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3613
movq -0x38(%rbp), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x3613
jmp 0x360c
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rax
subq %rax, %rdx
addq $0x1, %rdx
leaq 0x5ed3(%rip), %rdi      # 0x9489
callq 0x2070
cmpl $0x0, %eax
jne 0x3608
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x3650
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jge 0x35e0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3613
cmpq $0x7fffffff, -0x38(%rbp) # imm = 0x7FFFFFFF
jle 0x35f3
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3613
movq -0x38(%rbp), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x3613
jmp 0x360c
jmp 0x360c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)