// File: /workspace/github_c_makefile_star2_O1/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 0xed1c
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rdi, %r14
cmpq $0x0, 0xd0(%rdi)
je 0xed1d
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 0xed2f
testb $0x2, 0x11(%rax)
jne 0xed0c
movzbl (%r14), %edi
callq 0x1ff27
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0xf006
movq %rax, %rbx
movl $0x1ff00, %eax          # imm = 0x1FF00
andl (%r14), %eax
cmpl $0x1000, %eax           # imm = 0x1000
jne 0xeda7
leaq 0x4ac61(%rip), %r13     # 0x599c0
xorl %r15d, %r15d
leaq 0x3d7fa(%rip), %r12     # 0x4c563
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 0xed9a
movq (%r13), %rsi
movq %rbx, %rdi
movq %r12, %rdx
callq 0xe200
incq %r15
addq $0x8, %r13
cmpq $0x20, %r15
jne 0xed69
movq %r14, %rdi
callq 0x1f564
movl 0x50(%r14), %ecx
leaq 0x3c16e(%rip), %r15     # 0x4af28
movq %rsp, %r12
movl $0x100, %esi            # imm = 0x100
movq %r12, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xe2f0
leaq 0x323e7(%rip), %rsi     # 0x411bd
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 0x3414b(%rip), %rsi     # 0x42f4c
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 0x3239e(%rip), %rsi     # 0x411ca
movq %rbx, %rdi
movq %r12, %rdx
callq 0xe200
cmpb $0x3, (%r14)
movq %r14, %rax
jne 0xee44
movq 0x60(%r14), %rax
cmpb $0x9, (%rax)
jne 0xee4d
movq 0x60(%rax), %rax
cmpb $0xb, (%rax)
jne 0xee82
movzbl 0x54(%r14), %ecx
leaq 0x3c0ca(%rip), %rdx     # 0x4af28
movq %rsp, %r15
movl $0x100, %esi            # imm = 0x100
movq %r15, %rdi
xorl %eax, %eax
callq 0xe2f0
leaq 0x3234f(%rip), %rsi     # 0x411c6
movq %rbx, %rdi
movq %r15, %rdx
callq 0xe200
movq 0x60(%r14), %rdi
testq %rdi, %rdi
je 0xeee1
callq 0x1d8b6
testq %rax, %rax
je 0xee9e
leaq 0x32278(%rip), %rsi     # 0x41114
jmp 0xeed6
movq 0x60(%r14), %rdi
cmpq $0x0, 0xd0(%rdi)
jne 0xeeb8
movq 0x5861d(%rip), %rsi     # 0x674d0
callq 0xecea
movq 0x60(%r14), %rax
movq 0xd0(%rax), %rdi
leaq 0x35dfe(%rip), %rsi     # 0x44cc8
callq 0xe2d0
leaq 0x32234(%rip), %rsi     # 0x4110a
movq %rbx, %rdi
movq %rax, %rdx
callq 0xe200
movq 0x58(%r14), %rdi
testq %rdi, %rdi
je 0xef1c
callq 0xfa21
leaq 0x3c032(%rip), %rdx     # 0x4af28
movq %rsp, %r15
movl $0x100, %esi            # imm = 0x100
movq %r15, %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0xe2f0
leaq 0x32215(%rip), %rsi     # 0x41126
movq %rbx, %rdi
movq %r15, %rdx
callq 0xe200
movzbl (%r14), %eax
leal -0x7(%rax), %ecx
cmpl $0x2, %ecx
jb 0xef90
testl %eax, %eax
je 0xefe7
cmpl $0x5, %eax
jne 0xed0c
movq 0x88(%r14), %r14
testq %r14, %r14
je 0xed0c
movq %r14, %r15
movzwl (%r15), %eax
testb %al, %al
jle 0xef82
xorl %r12d, %r12d
movq 0x18(%r15,%r12,8), %rdi
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0xef6b
testq %rdi, %rdi
je 0xef73
movq %rbx, %rsi
callq 0xecea
incq %r12
movl (%r15), %eax
movsbq %al, %rcx
cmpq %rcx, %r12
jl 0xef57
movq 0x10(%r15), %r15
cmpq %r14, %r15
jne 0xef4c
jmp 0xed0c
movq 0x98(%r14), %r14
testq %r14, %r14
je 0xed0c
movq %r14, %r15
movzwl (%r15), %eax
testb %al, %al
jle 0xefd9
xorl %r12d, %r12d
movq 0x18(%r15,%r12,8), %rdi
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
jb 0xefc2
testq %rdi, %rdi
je 0xefca
movq %rbx, %rsi
callq 0xecea
incq %r12
movl (%r15), %eax
movsbq %al, %rcx
cmpq %rcx, %r12
jl 0xefae
movq 0x10(%r15), %r15
cmpq %r14, %r15
jne 0xefa3
jmp 0xed0c
movq %r14, %rdi
callq 0x1d8b6
leaq 0x3211e(%rip), %rsi     # 0x41114
movq %rbx, %rdi
movq %rax, %rdx
callq 0xe200
jmp 0xed0c