// File: /workspace/github_c_makefile_star2_O0/saltyJeff[P]uClibcpp/extra/config/./symbol.c
// Function: sym_lookup
struct symbol *sym_lookup(const char *name, int isconst)
{
	struct symbol *symbol;
	const char *ptr;
	char *new_name;
	int hash = 0;

	if (name) {
		if (name[0] && !name[1]) {
			switch (name[0]) {
			case 'y': return &symbol_yes;
			case 'm': return &symbol_mod;
			case 'n': return &symbol_no;
			}
		}
		for (ptr = name; *ptr; ptr++)
			hash += *ptr;
		hash &= 0xff;

		for (symbol = symbol_hash[hash]; symbol; symbol = symbol->next) {
			if (!strcmp(symbol->name, name)) {
				if ((isconst && symbol->flags & SYMBOL_CONST) ||
				    (!isconst && !(symbol->flags & SYMBOL_CONST)))
					return symbol;
			}
		}
		new_name = strdup(name);
	} else {
		new_name = NULL;
		hash = 256;
	}

	symbol = malloc(sizeof(*symbol));
	memset(symbol, 0, sizeof(*symbol));
	symbol->name = new_name;
	symbol->type = S_UNKNOWN;
	symbol->flags = SYMBOL_NEW;
	if (isconst)
		symbol->flags |= SYMBOL_CONST;

	symbol->next = symbol_hash[hash];
	symbol_hash[hash] = symbol;

	return symbol;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movl $0x0, 0x4(%rsp)
cmpq $0x0, 0x28(%rsp)
je 0x604b
movq 0x28(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x5f74
movq 0x28(%rsp), %rax
cmpb $0x0, 0x1(%rax)
jne 0x5f74
movq 0x28(%rsp), %rax
movsbl (%rax), %eax
movl %eax, (%rsp)
subl $0x6d, %eax
je 0x5f50
jmp 0x5f2b
movl (%rsp), %eax
subl $0x6e, %eax
je 0x5f61
jmp 0x5f35
movl (%rsp), %eax
subl $0x79, %eax
jne 0x5f72
jmp 0x5f3f
leaq 0x13342(%rip), %rax     # 0x19288
movq %rax, 0x30(%rsp)
jmp 0x60ee
leaq 0x133a1(%rip), %rax     # 0x192f8
movq %rax, 0x30(%rsp)
jmp 0x60ee
leaq 0x132b0(%rip), %rax     # 0x19218
movq %rax, 0x30(%rsp)
jmp 0x60ee
jmp 0x5f74
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpb $0x0, (%rax)
je 0x5fa8
movq 0x10(%rsp), %rax
movsbl (%rax), %eax
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x5f7e
movl 0x4(%rsp), %eax
andl $0xff, %eax
movl %eax, 0x4(%rsp)
movslq 0x4(%rsp), %rcx
leaq 0x1354f(%rip), %rax     # 0x19510
movq (%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0x603a
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x28(%rsp), %rsi
callq 0x2180
cmpl $0x0, %eax
jne 0x6029
cmpl $0x0, 0x24(%rsp)
je 0x6001
movq 0x18(%rsp), %rax
movl 0x44(%rax), %eax
andl $0x7, %eax
cmpl $0x0, %eax
jne 0x6018
cmpl $0x0, 0x24(%rsp)
jne 0x6027
movq 0x18(%rsp), %rax
movl 0x44(%rax), %eax
andl $0x7, %eax
cmpl $0x0, %eax
jne 0x6027
movq 0x18(%rsp), %rax
movq %rax, 0x30(%rsp)
jmp 0x60ee
jmp 0x6029
jmp 0x602b
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0x5fca
movq 0x28(%rsp), %rdi
callq 0x22f0
movq %rax, 0x8(%rsp)
jmp 0x605c
movq $0x0, 0x8(%rsp)
movl $0x100, 0x4(%rsp)       # imm = 0x100
movl $0x70, %edi
callq 0x2220
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
xorl %esi, %esi
movl $0x70, %edx
callq 0x2120
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rax
movl $0x0, 0x18(%rax)
movq 0x18(%rsp), %rax
movl $0x800, 0x44(%rax)      # imm = 0x800
cmpl $0x0, 0x24(%rsp)
je 0x60b7
movq 0x18(%rsp), %rax
movl 0x44(%rax), %ecx
orl $0x7, %ecx
movl %ecx, 0x44(%rax)
movslq 0x4(%rsp), %rcx
leaq 0x1344d(%rip), %rax     # 0x19510
movq (%rax,%rcx,8), %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x18(%rsp), %rdx
movslq 0x4(%rsp), %rcx
leaq 0x13430(%rip), %rax     # 0x19510
movq %rdx, (%rax,%rcx,8)
movq 0x18(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax,%rax)