// File: /workspace/github_c_makefile_star2_O0/saltyJeff[P]uClibcpp/extra/config/./symbol.c
// Function: sym_set_string_value
bool sym_set_string_value(struct symbol *sym, const char *newval)
{
	const char *oldval;
	char *val;
	int size;

	switch (sym->type) {
	case S_BOOLEAN:
	case S_TRISTATE:
		switch (newval[0]) {
		case 'y': case 'Y':
			return sym_set_tristate_value(sym, yes);
		case 'm': case 'M':
			return sym_set_tristate_value(sym, mod);
		case 'n': case 'N':
			return sym_set_tristate_value(sym, no);
		}
		return false;
	default:
		;
	}

	if (!sym_string_within_range(sym, newval))
		return false;

	if (sym->flags & SYMBOL_NEW) {
		sym->flags &= ~SYMBOL_NEW;
		sym_set_changed(sym);
	}

	oldval = sym->user.val;
	size = strlen(newval) + 1;
	if (sym->type == S_HEX && (newval[0] != '0' || (newval[1] != 'x' && newval[1] != 'X'))) {
		size += 2;
		sym->user.val = val = malloc(size);
		*val++ = '0';
		*val++ = 'x';
	} else if (!oldval || strcmp(oldval, newval))
		sym->user.val = val = malloc(size);
	else
		return true;

	strcpy(val, newval);
	free((void *)oldval);
	sym_clear_all_valid();

	return true;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rax
movl 0x18(%rax), %eax
decl %eax
subl $0x1, %eax
ja 0xf272
jmp 0xf1d3
movq 0x20(%rsp), %rax
movsbl (%rax), %eax
movl %eax, 0x8(%rsp)
subl $0x4d, %eax
je 0xf237
jmp 0xf1e6
movl 0x8(%rsp), %eax
subl $0x4e, %eax
je 0xf251
jmp 0xf1f1
movl 0x8(%rsp), %eax
subl $0x59, %eax
je 0xf21d
jmp 0xf1fc
movl 0x8(%rsp), %eax
subl $0x6d, %eax
je 0xf237
jmp 0xf207
movl 0x8(%rsp), %eax
subl $0x6e, %eax
je 0xf251
jmp 0xf212
movl 0x8(%rsp), %eax
subl $0x79, %eax
jne 0xf268
jmp 0xf21d
movq 0x28(%rsp), %rdi
movl $0x2, %esi
callq 0xf020
andb $0x1, %al
movb %al, 0x37(%rsp)
jmp 0xf3c7
movq 0x28(%rsp), %rdi
movl $0x1, %esi
callq 0xf020
andb $0x1, %al
movb %al, 0x37(%rsp)
jmp 0xf3c7
movq 0x28(%rsp), %rdi
xorl %esi, %esi
callq 0xf020
andb $0x1, %al
movb %al, 0x37(%rsp)
jmp 0xf3c7
movb $0x0, 0x37(%rsp)
jmp 0xf3c7
jmp 0xf274
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0xaa00
testb $0x1, %al
jne 0xf291
movb $0x0, 0x37(%rsp)
jmp 0xf3c7
movq 0x28(%rsp), %rax
movl 0x44(%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0xf2be
movq 0x28(%rsp), %rax
movl 0x44(%rax), %ecx
andl $0xfffff7ff, %ecx       # imm = 0xFFFFF7FF
movl %ecx, 0x44(%rax)
movq 0x28(%rsp), %rdi
callq 0xee70
movq 0x28(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rdi
callq 0x20d0
addq $0x1, %rax
movl %eax, 0xc(%rsp)
movq 0x28(%rsp), %rax
cmpl $0x4, 0x18(%rax)
jne 0xf362
movq 0x20(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0xf312
movq 0x20(%rsp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x78, %eax
je 0xf362
movq 0x20(%rsp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x58, %eax
je 0xf362
movl 0xc(%rsp), %eax
addl $0x2, %eax
movl %eax, 0xc(%rsp)
movslq 0xc(%rsp), %rdi
callq 0x2220
movq %rax, %rcx
movq %rcx, 0x10(%rsp)
movq 0x28(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rsp)
movb $0x30, (%rax)
movq 0x10(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x10(%rsp)
movb $0x78, (%rax)
jmp 0xf3a4
cmpq $0x0, 0x18(%rsp)
je 0xf37e
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x2180
cmpl $0x0, %eax
je 0xf39b
movslq 0xc(%rsp), %rdi
callq 0x2220
movq %rax, %rcx
movq %rcx, 0x10(%rsp)
movq 0x28(%rsp), %rax
movq %rcx, 0x30(%rax)
jmp 0xf3a2
movb $0x1, 0x37(%rsp)
jmp 0xf3c7
jmp 0xf3a4
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x2090
movq 0x18(%rsp), %rdi
callq 0x2040
callq 0xb5d0
movb $0x1, 0x37(%rsp)
movb 0x37(%rsp), %al
andb $0x1, %al
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)