// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/c2xml.c
// Function: examine_symbol
static void examine_symbol(struct symbol *sym, xmlNodePtr node)
{
	xmlNodePtr child = NULL;
	const char *base;
	int array_size;

	if (!sym)
		return;
	if (sym->aux)		/*already visited */
		return;

	if (sym->ident && sym->ident->reserved)
		return;

	child = new_sym_node(sym, get_type_name(sym->type), node);
	examine_modifiers(sym, child);
	examine_layout(sym, child);

	if (sym->ctype.base_type) {
		if ((base = builtin_typename(sym->ctype.base_type)) == NULL) {
			if (!sym->ctype.base_type->aux) {
				examine_symbol(sym->ctype.base_type, root_node);
			}
			xmlNewProp(child, BAD_CAST "base-type",
			           xmlGetProp((xmlNodePtr)sym->ctype.base_type->aux, BAD_CAST "id"));
		} else {
			newProp(child, "base-type-builtin", base);
		}
	}
	if (sym->array_size) {
		/* TODO: modify get_expression_value to give error return */
		array_size = get_expression_value(sym->array_size);
		newNumProp(child, "array-size", array_size);
	}


	switch (sym->type) {
	case SYM_STRUCT:
	case SYM_UNION:
		examine_members(sym->symbol_list, child);
		break;
	case SYM_FN:
		examine_members(sym->arguments, child);
		break;
	case SYM_UNINITIALIZED:
		newProp(child, "base-type-builtin", builtin_typename(sym));
		break;
	default:
		break;
	}
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x11944
jmp 0x11b0a
movq -0x8(%rbp), %rax
cmpq $0x0, 0xd0(%rax)
je 0x11957
jmp 0x11b0a
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x1197e
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movb 0x11(%rax), %al
shrb %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x1197e
jmp 0x11b0a
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %edi
andl $0xff, %edi
callq 0x2e010
movq -0x30(%rbp), %rdi
movq %rax, %rsi
movq -0x10(%rbp), %rdx
callq 0x11b80
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x11ec0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x11f90
movq -0x8(%rbp), %rax
cmpq $0x0, 0x60(%rax)
je 0x11a5f
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rdi
callq 0x2a4a0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x11a49
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
cmpq $0x0, 0xd0(%rax)
jne 0x11a11
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rdi
movq 0x7aec4(%rip), %rsi     # 0x8c8d0
callq 0x11920
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq 0xd0(%rax), %rdi
leaq 0x53bfb(%rip), %rsi     # 0x6562a
callq 0x112c0
movq -0x38(%rbp), %rdi
movq %rax, %rdx
leaq 0x506a4(%rip), %rsi     # 0x620e6
callq 0x111e0
jmp 0x11a5d
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x50698(%rip), %rsi     # 0x620f0
callq 0x11df0
jmp 0x11a5f
movq -0x8(%rbp), %rax
cmpq $0x0, 0x58(%rax)
je 0x11a8d
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdi
callq 0x12b10
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %edx
leaq 0x5067a(%rip), %rsi     # 0x62102
callq 0x11e70
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x3c(%rbp)
testl %eax, %eax
je 0x11ae0
jmp 0x11a9d
movl -0x3c(%rbp), %eax
subl $0x5, %eax
je 0x11aca
jmp 0x11aa7
movl -0x3c(%rbp), %eax
addl $-0x7, %eax
subl $0x1, %eax
ja 0x11b06
jmp 0x11ab4
movq -0x8(%rbp), %rax
movq 0x98(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x12030
jmp 0x11b08
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x12030
jmp 0x11b08
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2a4a0
movq -0x48(%rbp), %rdi
movq %rax, %rdx
leaq 0x505f1(%rip), %rsi     # 0x620f0
callq 0x11df0
jmp 0x11b08
jmp 0x11b08
jmp 0x11b0a
addq $0x50, %rsp
popq %rbp
retq