// File: /workspace/github_c_makefile_star2_O1/nimble-code[P]Modex/Src/xtract.c
// Function: do_prefix
void
do_prefix(leafnode *n)
{	Fcts *g;
	static char buf[2048];
	char *s;

	s = n->data.sval->str;
	/* fp=stdout; */
	if (0 && fp)	fprintf(fp, "\n<<%3d: do_prefix --%s-- <%s> <%s> <%s> (%d,%d,%d) [%s] (%d,%d)>>\n",
		n->hdr.line, s, dertype, derproc, dername,
		in_call, in_args, is_label, OutBuf, in_call, ByPass);

	if (strlen(OutBuf) > 2
	&& (strstr(&OutBuf[strlen(OutBuf)-2], "->")
	||  strstr(&OutBuf[strlen(OutBuf)-1], ".")))
		return;	/* no prefix here */

	if (ByPass)
	{	if(0) fprintf(stderr, "	bypass (%d)\n", ByPass);
		return;	/* in the middle of a struct reference */
	}

	if (!n->syment)	/* not a variable name - i.e., no declaration appears in the source */
	{
if (debug)		fprintf(stderr, "%3d: --not a varname --%s-- <%s> <%s> <%s> (%d,%d,%d)\n",
			n->hdr.line, s, dertype, derproc, dername,
			in_call, in_args, is_label);

		/* it could have been declared in the lut... */
		for (g = modex_globals; g; g = g->nxt)
			if (!g->derived && strcmp(g->nm, s) == 0)
				goto b;

		add_hidden("Global", s, 1, n->hdr.line);
		return;
	}

	if (n->syment->kind == LABEL_ENTRY
	||  n->syment->kind == TAG_ENTRY)
		return;

if (0 && fp) fprintf(fp, "\n\t/* maptype=%d - kind=%d - decl_level=%d - owner_t=%d owner=%s */\n",
		map_type(s, n->syment),
		n->syment->kind,
		n->syment->decl_level,
		n->syment->nes && n->syment->nes->owner ? n->syment->nes->owner_t : -1,
		n->syment->nes && n->syment->nes->owner ? n->syment->nes->owner : "no owner");

	switch (map_type(s, n->syment)) {
	case 1:	/* local */
a:		if (strcmp(wanttype, "inline") != 0)
		{	sprintf(buf, "Pp_%s->", fct_name);
			vis_print(buf);
		}
		break;

	case 2:	/* global */
b:		vis_print("now.");
		break;

	case 3:	/* hidden global */
c:		break;

	default: /* undefined */
		if (in_call) return;	/* function name */

		if (n->syment->decl_level < 3)	/* global scope */
		{	char oder[512];
			strcpy(oder, derproc);
			strcpy(derproc, "");
			derive_type("Global", n->syment->node);
			if (strcmp(dertype, "extern ") == 0)
				break;
			strcpy(derproc, oder);

			if (!imported(dername, "Global", 0))
				goto c;

			if (n->syment->kind == TYPEDEF_ENTRY)	/* 2.6 new */
				goto c;

			add_full_global(dertype, dername, 1, n->hdr.line);
			goto b;
		} else if (n->syment->nes && n->syment->nes->owner)
		{
			if (in_args)
				strcpy(derproc, fct_name);
			else
				strcpy(derproc, n->syment->nes->owner);
			derive_type("Local", n->syment->node);
			if (Verbose&2)
			fprintf(stderr, "%3d, ==s=%s, proc=%s, type=%s, name=%s, own=%s, [obuf= %s]\n",
			n->hdr.line, s, derproc, dertype, dername, n->syment->nes->owner, OutBuf);

			if (strcmp(n->syment->nes->owner, "-") != 0)
			{
				if (!imported(dername, derproc, 0))
					goto c;
			
				add_full_local(dertype, dername, derproc, 1, n->hdr.line);
				goto a;
			}

			if (strcmp(dername, "") != 0
			&&  dername[strlen(dername)-1] != '*')
			{	if (debug || (Verbose&2))
				fprintf(stderr, "%3d: derived hidden <%s> <%s> <%s> <%s> (%d %d %d)\n",
					n->hdr.line,
					dertype, dername, derproc, fct_name,
					in_call, in_args, is_label);

				if (strlen(fct_name) > 0
				&&  in_args)	/* formal params */
					add_local(dertype, dername, fct_name, 1, n->hdr.line, 50);
				else
					add_hidden(dertype, dername, 1, n->hdr.line);
			}
			break;
		}
		/* else leave it hidden -- shouldn't happen */
		if (0 /* (Verbose&2) */)
		{	fprintf(stderr, "%s: unexpected (var %s) kind=%d\n", s,
				progname, n->syment->kind);
			if (fp) fprintf(fp, "  /* unexpected (var %s) */", s);
		}

		break;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, %rbx
movq 0x30(%rdi), %rax
movq 0x8(%rax), %r14
leaq 0x26ecd(%rip), %r15     # 0x3a370
movq %r15, %rdi
callq 0x4110
cmpq $0x3, %rax
jb 0x134eb
movq %rax, %r12
leaq (%rax,%r15), %rdi
addq $-0x2, %rdi
leaq 0x1285e(%rip), %rsi     # 0x25d21
callq 0x42c0
testq %rax, %rax
jne 0x135dd
leaq (%r12,%r15), %rdi
decq %rdi
movl $0x2e, %esi
callq 0x4130
testq %rax, %rax
jne 0x135dd
cmpb $0x0, 0x3080e(%rip)     # 0x43d00
jne 0x135dd
movq 0x28(%rbx), %rsi
testq %rsi, %rsi
je 0x135ec
movl (%rsi), %eax
addl $-0x5, %eax
cmpl $0x2, %eax
jb 0x135dd
movq %r14, %rdi
callq 0xfb42
movl %eax, %eax
leaq 0x11a4c(%rip), %rcx     # 0x24f70
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, 0x28e74(%rip)     # 0x3c3a8
jne 0x135dd
movq 0x28(%rbx), %r12
cmpw $0x2, 0x20(%r12)
jg 0x13639
leaq 0x311fe(%rip), %rsi     # 0x44750
movq %rsp, %rdi
callq 0x40b0
movb $0x0, 0x311ef(%rip)     # 0x44750
movq 0x10(%r12), %rsi
leaq 0xfb49(%rip), %rdi      # 0x230b6
callq 0x13404
movabsq $0x206e7265747865, %rax # imm = 0x206E7265747865
cmpq %rax, 0x30dad(%rip)     # 0x44330
je 0x135dd
leaq 0x311c4(%rip), %rdi     # 0x44750
movq %rsp, %rsi
callq 0x40b0
leaq 0x28e35(%rip), %rdi     # 0x3c3d0
leaq 0xfb14(%rip), %rsi      # 0x230b6
xorl %edx, %edx
callq 0xe686
testl %eax, %eax
je 0x135dd
movq 0x28(%rbx), %rax
cmpl $0x1, (%rax)
je 0x135dd
movl 0x10(%rbx), %ecx
leaq 0x30d70(%rip), %rdi     # 0x44330
leaq 0x28e09(%rip), %rsi     # 0x3c3d0
movl $0x1, %edx
callq 0xcbbe
leaq 0x11a59(%rip), %rdi     # 0x25031
callq 0x12436
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x28dc5(%rip), %r15     # 0x3c3b8
testq %r15, %r15
je 0x13614
cmpl $0x0, 0x24(%r15)
jne 0x1360e
movq (%r15), %rdi
movq %r14, %rsi
callq 0x41b0
testl %eax, %eax
je 0x135d1
movq 0x38(%r15), %r15
jmp 0x135f3
movl 0x10(%rbx), %ecx
leaq 0xfa98(%rip), %rdi      # 0x230b6
movq %r14, %rsi
movl $0x1, %edx
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xc854
movq 0x18(%r12), %rax
testq %rax, %rax
je 0x135dd
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x135dd
cmpl $0x0, 0x28d59(%rip)     # 0x3c3ac
leaq 0x23d26(%rip), %rsi     # 0x37380
cmoveq %rax, %rsi
leaq 0x310eb(%rip), %rdi     # 0x44750
callq 0x40b0
movq 0x28(%rbx), %rax
movq 0x10(%rax), %rsi
leaq 0x123df(%rip), %rdi     # 0x25a58
callq 0x13404
leaq 0x263e7(%rip), %r12     # 0x39a6c
testb $0x2, (%r12)
jne 0x137bd
movq 0x28(%rbx), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rdi
leaq 0x113f8(%rip), %rsi     # 0x24a9b
callq 0x41b0
testl %eax, %eax
je 0x13743
leaq 0x28d19(%rip), %rdi     # 0x3c3d0
leaq 0x31092(%rip), %rsi     # 0x44750
xorl %edx, %edx
callq 0xe686
testl %eax, %eax
je 0x135dd
movl 0x10(%rbx), %r8d
leaq 0x30c58(%rip), %rdi     # 0x44330
leaq 0x28cf1(%rip), %rsi     # 0x3c3d0
leaq 0x3106a(%rip), %rdx     # 0x44750
movl $0x1, %ecx
callq 0xdd1a
leaq 0x23ab1(%rip), %rax     # 0x371a8
movq (%rax), %rdi
leaq 0x10bb9(%rip), %rsi     # 0x242ba
callq 0x41b0
testl %eax, %eax
je 0x135dd
leaq 0x3225b(%rip), %rbx     # 0x45970
leaq 0x1190d(%rip), %rsi     # 0x25029
leaq 0x23c5d(%rip), %rdx     # 0x37380
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4290
movq %rbx, %rdi
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x12436
cmpb $0x0, 0x28c86(%rip)     # 0x3c3d0
je 0x135dd
leaq 0x28c79(%rip), %r14     # 0x3c3d0
movq %r14, %rdi
callq 0x4110
cmpb $0x2a, -0x1(%rax,%r14)
je 0x135dd
testb $0x2, (%r12)
jne 0x13828
cmpb $0x0, 0x23c03(%rip)     # 0x37380
movl 0x10(%rbx), %r8d
je 0x1380d
cmpl $0x0, 0x28c1e(%rip)     # 0x3c3ac
je 0x1380d
leaq 0x30b99(%rip), %rdi     # 0x44330
leaq 0x28c32(%rip), %rsi     # 0x3c3d0
leaq 0x23bdb(%rip), %rdx     # 0x37380
movl $0x1, %ecx
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xda99
movq 0x23834(%rip), %rax     # 0x36ff8
movq (%rax), %rdi
movl 0x10(%rbx), %edx
movq 0x28(%rbx), %rax
movq 0x18(%rax), %r10
subq $0x8, %rsp
leaq 0x28bf3(%rip), %r11     # 0x3c3d0
leaq 0x12739(%rip), %rsi     # 0x25f1d
leaq 0x30f65(%rip), %r8      # 0x44750
leaq 0x30b3e(%rip), %r9      # 0x44330
movq %r14, %rcx
xorl %eax, %eax
pushq %r15
pushq 0x18(%r10)
pushq %r11
callq 0x41c0
addq $0x20, %rsp
jmp 0x13690
leaq 0x30b1c(%rip), %rdi     # 0x44330
leaq 0x28bb5(%rip), %rsi     # 0x3c3d0
movl $0x1, %edx
movl %r8d, %ecx
jmp 0x13626
movq %rbx, %rdi
callq 0x4e8f
jmp 0x13776