// File: /workspace/github_c_makefile_star2_O3/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:
testq %rdi, %rdi
je 0xed31
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rdi, %r14
cmpq $0x0, 0xd0(%rdi)
je 0xed32
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rsi, %rbx
movq 0x18(%r14), %rax
testq %rax, %rax
je 0xed44
testb $0x2, 0x11(%rax)
jne 0xed21
movzbl (%r14), %edi
callq 0x1fe3b
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0xf033
movq %rax, %rbx
movl $0x1ff00, %eax          # imm = 0x1FF00
andl (%r14), %eax
cmpl $0x1000, %eax           # imm = 0x1000
jne 0xedbc
leaq 0x48c5c(%rip), %r13     # 0x579d0
xorl %r15d, %r15d
leaq 0x3c775(%rip), %r12     # 0x4b4f3
movl $0x1, %eax
movl %r15d, %ecx
shll %cl, %eax
cltq
testq %rax, 0x68(%r14)
sete %al
leaq -0xd(%r15), %rcx
cmpq $0x5, %rcx
setb %cl
orb %al, %cl
jne 0xedaf
movq (%r13), %rsi
movq %rbx, %rdi
movq %r12, %rdx
callq 0xe200
incq %r15
addq $0x8, %r13
cmpq $0x20, %r15
jne 0xed7e
movq %r14, %rdi
callq 0x1f468
movl 0x50(%r14), %ecx
leaq 0x3b0e9(%rip), %r15     # 0x49eb8
movq %rsp, %r12
movl $0x100, %esi            # imm = 0x100
movq %r12, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe2f0
leaq 0x313c6(%rip), %rsi     # 0x401b1
movq %rbx, %rdi
movq %r12, %rdx
callq 0xe200
movl 0x70(%r14), %ecx
movq %rsp, %r12
movl $0x100, %esi            # imm = 0x100
movq %r12, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe2f0
leaq 0x3312a(%rip), %rsi     # 0x41f40
movq %rbx, %rdi
movq %r12, %rdx
callq 0xe200
movl 0x48(%r14), %ecx
movq %rsp, %r12
movl $0x100, %esi            # imm = 0x100
movq %r12, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe2f0
leaq 0x3137d(%rip), %rsi     # 0x401be
movq %rbx, %rdi
movq %r12, %rdx
callq 0xe200
movzbl (%r14), %eax
movq %r14, %rcx
cmpl $0x3, %eax
jne 0xee5f
movq 0x60(%r14), %rcx
movzbl (%rcx), %eax
cmpl $0x9, %eax
jne 0xee6b
movq 0x60(%rcx), %rax
movzbl (%rax), %eax
cmpl $0xb, %eax
jne 0xeea0
movzbl 0x54(%r14), %ecx
leaq 0x3b03c(%rip), %rdx     # 0x49eb8
movq %rsp, %r15
movl $0x100, %esi            # imm = 0x100
movq %r15, %rdi
xorl %eax, %eax
callq 0xe2f0
leaq 0x31325(%rip), %rsi     # 0x401ba
movq %rbx, %rdi
movq %r15, %rdx
callq 0xe200
movq 0x60(%r14), %rdi
testq %rdi, %rdi
je 0xef04
callq 0x1d819
testq %rax, %rax
je 0xeebc
leaq 0x3124e(%rip), %rsi     # 0x40108
jmp 0xeef9
movq 0x60(%r14), %rax
movq 0xd0(%rax), %rdi
testq %rdi, %rdi
jne 0xeee6
movq 0x565fd(%rip), %rsi     # 0x654d0
movq %rax, %rdi
callq 0xecff
movq 0x60(%r14), %rax
movq 0xd0(%rax), %rdi
leaq 0x34dcf(%rip), %rsi     # 0x43cbc
callq 0xe2d0
leaq 0x31205(%rip), %rsi     # 0x400fe
movq %rbx, %rdi
movq %rax, %rdx
callq 0xe200
movq 0x58(%r14), %rdi
testq %rdi, %rdi
je 0xef3f
callq 0xfbd5
leaq 0x3af9f(%rip), %rdx     # 0x49eb8
movq %rsp, %r15
movl $0x100, %esi            # imm = 0x100
movq %r15, %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0xe2f0
leaq 0x311e6(%rip), %rsi     # 0x4011a
movq %rbx, %rdi
movq %r15, %rdx
callq 0xe200
movzbl (%r14), %eax
leal -0x7(%rax), %ecx
cmpl $0x2, %ecx
jb 0xefb8
testl %eax, %eax
je 0xf014
cmpl $0x5, %eax
jne 0xed21
movq 0x88(%r14), %r14
testq %r14, %r14
je 0xed21
movq %r14, %r15
movzwl (%r15), %eax
testb %al, %al
jle 0xefaa
xorl %r12d, %r12d
movq 0x18(%r15,%r12,8), %rdi
movzwl %ax, %ecx
cmpl $0x100, %ecx            # imm = 0x100
jb 0xef8f
testq %rdi, %rdi
je 0xef9b
movq %rbx, %rsi
callq 0xecff
movzwl (%r15), %eax
incq %r12
movzwl %ax, %ecx
movsbq %cl, %rcx
cmpq %rcx, %r12
jl 0xef7a
movq 0x10(%r15), %r15
cmpq %r14, %r15
jne 0xef6f
jmp 0xed21
movq 0x98(%r14), %r14
testq %r14, %r14
je 0xed21
movq %r14, %r15
movzwl (%r15), %eax
testb %al, %al
jle 0xf006
xorl %r12d, %r12d
movq 0x18(%r15,%r12,8), %rdi
movzwl %ax, %ecx
cmpl $0x100, %ecx            # imm = 0x100
jb 0xefeb
testq %rdi, %rdi
je 0xeff7
movq %rbx, %rsi
callq 0xecff
movzwl (%r15), %eax
incq %r12
movzwl %ax, %ecx
movsbq %cl, %rcx
cmpq %rcx, %r12
jl 0xefd6
movq 0x10(%r15), %r15
cmpq %r14, %r15
jne 0xefcb
jmp 0xed21
movq %r14, %rdi
callq 0x1d819
leaq 0x310e5(%rip), %rsi     # 0x40108
movq %rbx, %rdi
movq %rax, %rdx
callq 0xe200
jmp 0xed21