// File: /workspace/github_c_makefile_star2_O0/saltyJeff[P]uClibcpp/extra/config/./symbol.c
// Function: sym_string_valid
bool sym_string_valid(struct symbol *sym, const char *str)
{
	char ch;

	switch (sym->type) {
	case S_STRING:
		return true;
	case S_INT:
		ch = *str++;
		if (ch == '-')
			ch = *str++;
		if (!isdigit(ch))
			return false;
		if (ch == '0' && *str != 0)
			return false;
		while ((ch = *str++)) {
			if (!isdigit(ch))
				return false;
		}
		return true;
	case S_HEX:
		if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X'))
			str += 2;
		ch = *str++;
		do {
			if (!isxdigit(ch))
				return false;
		} while ((ch = *str++));
		return true;
	case S_BOOLEAN:
	case S_TRISTATE:
		switch (str[0]) {
		case 'y': case 'Y':
		case 'm': case 'M':
		case 'n': case 'N':
			return true;
		}
		return false;
	default:
		return false;
	}
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rax
movl 0x18(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, 0x10(%rsp)
subl $0x4, %eax
ja 0xa3f8
movq 0x10(%rsp), %rax
leaq 0x63c0(%rip), %rcx      # 0x105f4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x1, 0x37(%rsp)
jmp 0xa3fd
movq 0x20(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rsp)
movb (%rax), %al
movb %al, 0x1f(%rsp)
movsbl 0x1f(%rsp), %eax
cmpl $0x2d, %eax
jne 0xa27f
movq 0x20(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rsp)
movb (%rax), %al
movb %al, 0x1f(%rsp)
callq 0x2300
movq (%rax), %rax
movsbl 0x1f(%rsp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0xa2a7
movb $0x0, 0x37(%rsp)
jmp 0xa3fd
movsbl 0x1f(%rsp), %eax
cmpl $0x30, %eax
jne 0xa2c8
movq 0x20(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0xa2c8
movb $0x0, 0x37(%rsp)
jmp 0xa3fd
jmp 0xa2ca
movq 0x20(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rsp)
movb (%rax), %al
movb %al, 0x1f(%rsp)
cmpb $0x0, %al
je 0xa30f
callq 0x2300
movq (%rax), %rax
movsbl 0x1f(%rsp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0xa30d
movb $0x0, 0x37(%rsp)
jmp 0xa3fd
jmp 0xa2ca
movb $0x1, 0x37(%rsp)
jmp 0xa3fd
movq 0x20(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0xa350
movq 0x20(%rsp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x78, %eax
je 0xa342
movq 0x20(%rsp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x58, %eax
jne 0xa350
movq 0x20(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rsp)
movb (%rax), %al
movb %al, 0x1f(%rsp)
callq 0x2300
movq (%rax), %rax
movsbl 0x1f(%rsp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
jne 0xa38c
movb $0x0, 0x37(%rsp)
jmp 0xa3fd
jmp 0xa38e
movq 0x20(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rsp)
movb (%rax), %al
movb %al, 0x1f(%rsp)
cmpb $0x0, %al
jne 0xa367
movb $0x1, 0x37(%rsp)
jmp 0xa3fd
movq 0x20(%rsp), %rax
movsbl (%rax), %eax
movl %eax, 0xc(%rsp)
addl $-0x4d, %eax
subl $0x2, %eax
jb 0xa3ea
jmp 0xa3c6
movl 0xc(%rsp), %eax
subl $0x59, %eax
je 0xa3ea
jmp 0xa3d1
movl 0xc(%rsp), %eax
addl $-0x6d, %eax
subl $0x2, %eax
jb 0xa3ea
jmp 0xa3df
movl 0xc(%rsp), %eax
subl $0x79, %eax
jne 0xa3f1
jmp 0xa3ea
movb $0x1, 0x37(%rsp)
jmp 0xa3fd
movb $0x0, 0x37(%rsp)
jmp 0xa3fd
movb $0x0, 0x37(%rsp)
movb 0x37(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
retq
nopl (%rax,%rax)