// File: /workspace/github_c_makefile_star2_O2/lucvoo[P]sparse-dev/show-parse.c
// Function: do_debug_symbol
static void do_debug_symbol(struct symbol *sym, int indent)
{
	static const char indent_string[] = "                                  ";
	static const char *typestr[] = {
		[SYM_UNINITIALIZED] = "none",
		[SYM_PREPROCESSOR] = "cpp.",
		[SYM_BASETYPE] = "base",
		[SYM_NODE] = "node",
		[SYM_PTR] = "ptr.",
		[SYM_FN] = "fn..",
		[SYM_ARRAY] = "arry",
		[SYM_STRUCT] = "strt",
		[SYM_UNION] = "unin",
		[SYM_ENUM] = "enum",
		[SYM_TYPEOF] = "tpof",
		[SYM_BITFIELD] = "bitf",
		[SYM_LABEL] = "labl",
		[SYM_RESTRICT] = "rstr",
		[SYM_FOULED] = "foul",
		[SYM_BAD] = "bad.",
	};
	struct context *context;
	int i;

	if (!sym)
		return;
	fprintf(stderr, "%.*s%s%3d:%lu %s%s (as: %s) %p (%s:%d:%d) %s\n",
		indent, indent_string, typestr[sym->type],
		sym->bit_size, sym->ctype.alignment,
		modifier_string(sym->ctype.modifiers), show_ident(sym->ident),
		show_as(sym->ctype.as),
		sym, stream_name(sym->pos.stream), sym->pos.line, sym->pos.pos,
		builtin_typename(sym) ?: "");
	i = 0;
	FOR_EACH_PTR(sym->ctype.contexts, context) {
		/* FIXME: should print context expression */
		fprintf(stderr, "< context%d: in=%d, out=%d\n",
			i, context->in, context->out);
		fprintf(stderr, "  end context%d >\n", i);
		i++;
	} END_FOR_EACH_PTR(context);
	if (sym->type == SYM_FN) {
		struct symbol *arg;
		i = 0;
		FOR_EACH_PTR(sym->arguments, arg) {
			fprintf(stderr, "< arg%d:\n", i);
			do_debug_symbol(arg, 0);
			fprintf(stderr, "  end arg%d >\n", i);
			i++;
		} END_FOR_EACH_PTR(arg);
	}
	do_debug_symbol(sym->ctype.base_type, indent+2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, 0x8(%rsp)
movq %rdi, %r13
movq 0x39df8(%rip), %rbp     # 0x59ff0
testq %r13, %r13
je 0x203e8
movq (%rbp), %rax
movq %rax, 0x18(%rsp)
movzbl (%r13), %eax
leaq 0x32bfa(%rip), %rcx     # 0x52e10
movq (%rcx,%rax,8), %rax
movq %rax, 0x20(%rsp)
movl 0x50(%r13), %eax
movl %eax, 0xc(%rsp)
movq 0x70(%r13), %r14
movq 0x68(%r13), %rdi
callq 0x203f7
movq 0x18(%r13), %rdi
callq 0x2936d
movq %rax, (%rsp)
movq 0x80(%r13), %rdi
callq 0x206aa
movq %rax, 0x10(%rsp)
movl 0x4(%r13), %edi
shrl $0x6, %edi
andl $0x3fff, %edi           # imm = 0x3FFF
callq 0x292d8
movq %rax, %rbx
movq 0x4(%r13), %r12
movq %r12, %r15
shrq $0x20, %r15
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
shrl $0x16, %r12d
movq %r13, %rdi
callq 0x206bb
movq %rax, %r10
testq %rax, %rax
leaq 0x1963b(%rip), %rax     # 0x398cd
cmoveq %rax, %r10
subq $0x8, %rsp
movq 0x20(%rsp), %rdi
leaq 0x1f5c1(%rip), %rsi     # 0x3f867
movl 0x10(%rsp), %edx
leaq 0x1f37f(%rip), %rcx     # 0x3f630
movq 0x28(%rsp), %r8
movl 0x14(%rsp), %r9d
xorl %eax, %eax
pushq %r10
pushq %r12
pushq %r15
pushq %rbx
pushq %r13
pushq 0x40(%rsp)
pushq 0x38(%rsp)
leaq 0x4429b(%rip), %r10     # 0x64570
pushq %r10
pushq %r14
callq 0xe1d0
addq $0x50, %rsp
movq %r13, (%rsp)
movq 0x78(%r13), %r14
testq %r14, %r14
je 0x20355
xorl %ebx, %ebx
movq %r14, %r15
xorl %r12d, %r12d
movl (%r15), %ecx
movsbq %cl, %rax
cmpq %rax, %r12
jge 0x2034c
movq 0x18(%r15,%r12,8), %rax
cmpw $0x100, %cx             # imm = 0x100
jb 0x20319
testq %rax, %rax
jne 0x20319
incq %r12
jmp 0x202f7
movq (%rbp), %rdi
movl 0x8(%rax), %ecx
movl 0xc(%rax), %r8d
leaq 0x1f56a(%rip), %rsi     # 0x3f895
movl %ebx, %edx
xorl %eax, %eax
callq 0xe1d0
movq (%rbp), %rdi
leaq 0x1f572(%rip), %rsi     # 0x3f8b1
movl %ebx, %edx
xorl %eax, %eax
callq 0xe1d0
incl %ebx
jmp 0x20314
movq 0x10(%r15), %r15
cmpq %r14, %r15
jne 0x202f4
movq (%rsp), %rax
cmpb $0x5, (%rax)
jne 0x203d6
movq (%rsp), %rax
movq 0x88(%rax), %r15
testq %r15, %r15
je 0x203d6
xorl %ebx, %ebx
movq %r15, %r14
xorl %r12d, %r12d
movl (%r14), %eax
movsbq %al, %rcx
cmpq %rcx, %r12
jge 0x203cd
movq 0x18(%r14,%r12,8), %r13
cmpw $0x100, %ax             # imm = 0x100
jb 0x20397
testq %r13, %r13
jne 0x20397
incq %r12
jmp 0x20376
movq (%rbp), %rdi
leaq 0x1f522(%rip), %rsi     # 0x3f8c4
movl %ebx, %edx
xorl %eax, %eax
callq 0xe1d0
movq %r13, %rdi
xorl %esi, %esi
callq 0x201dc
movq (%rbp), %rdi
leaq 0x1f50e(%rip), %rsi     # 0x3f8ce
movl %ebx, %edx
xorl %eax, %eax
callq 0xe1d0
incl %ebx
jmp 0x20392
movq 0x10(%r14), %r14
cmpq %r15, %r14
jne 0x20373
movq (%rsp), %r13
movq 0x60(%r13), %r13
addl $0x2, 0x8(%rsp)
jmp 0x201f8
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq