// File: /workspace/github_c_makefile_star2_O3/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 0x25dcc(%rip), %r15     # 0x39380
movq %r15, %rdi
callq 0x4110
cmpq $0x3, %rax
jb 0x135fc
movq %rax, %r12
leaq (%rax,%r15), %rdi
addq $-0x2, %rdi
leaq 0x1174d(%rip), %rsi     # 0x24d21
callq 0x42d0
testq %rax, %rax
jne 0x136ee
leaq (%r12,%r15), %rdi
decq %rdi
movl $0x2e, %esi
callq 0x4130
testq %rax, %rax
jne 0x136ee
cmpb $0x0, 0x2f70d(%rip)     # 0x42d10
jne 0x136ee
movq 0x28(%rbx), %rsi
testq %rsi, %rsi
je 0x136fd
movl (%rsi), %eax
addl $-0x5, %eax
cmpl $0x2, %eax
jb 0x136ee
movq %r14, %rdi
callq 0xfa41
movl %eax, %eax
leaq 0x1093b(%rip), %rcx     # 0x23f70
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, 0x27d73(%rip)     # 0x3b3b8
jne 0x136ee
movq 0x28(%rbx), %r12
cmpw $0x2, 0x20(%r12)
jg 0x1374a
leaq 0x300fd(%rip), %rsi     # 0x43760
movq %rsp, %rdi
callq 0x40b0
movb $0x0, 0x300ee(%rip)     # 0x43760
movq 0x10(%r12), %rsi
leaq 0xea38(%rip), %rdi      # 0x220b6
callq 0x13515
movabsq $0x206e7265747865, %rax # imm = 0x206E7265747865
cmpq %rax, 0x2fcac(%rip)     # 0x43340
je 0x136ee
leaq 0x300c3(%rip), %rdi     # 0x43760
movq %rsp, %rsi
callq 0x40b0
leaq 0x27d34(%rip), %rdi     # 0x3b3e0
leaq 0xea03(%rip), %rsi      # 0x220b6
xorl %edx, %edx
callq 0xe541
testl %eax, %eax
je 0x136ee
movq 0x28(%rbx), %rax
cmpl $0x1, (%rax)
je 0x136ee
movl 0x10(%rbx), %ecx
leaq 0x2fc6f(%rip), %rdi     # 0x43340
leaq 0x27d08(%rip), %rsi     # 0x3b3e0
movl $0x1, %edx
callq 0xca69
leaq 0x10948(%rip), %rdi     # 0x24031
callq 0x12500
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x27cc4(%rip), %r15     # 0x3b3c8
testq %r15, %r15
je 0x13725
cmpl $0x0, 0x24(%r15)
jne 0x1371f
movq (%r15), %rdi
movq %r14, %rsi
callq 0x41c0
testl %eax, %eax
je 0x136e2
movq 0x38(%r15), %r15
jmp 0x13704
movl 0x10(%rbx), %ecx
leaq 0xe987(%rip), %rdi      # 0x220b6
movq %r14, %rsi
movl $0x1, %edx
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xc6f9
movq 0x18(%r12), %rax
testq %rax, %rax
je 0x136ee
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x136ee
cmpl $0x0, 0x27c58(%rip)     # 0x3b3bc
leaq 0x22c25(%rip), %rsi     # 0x36390
cmoveq %rax, %rsi
leaq 0x2ffea(%rip), %rdi     # 0x43760
callq 0x40b0
movq 0x28(%rbx), %rax
movq 0x10(%rax), %rsi
leaq 0x112ce(%rip), %rdi     # 0x24a58
callq 0x13515
leaq 0x252e6(%rip), %r12     # 0x38a7c
testb $0x2, (%r12)
jne 0x138c9
movq 0x28(%rbx), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rax
cmpb $0x2d, (%rax)
jne 0x137bc
cmpb $0x0, 0x1(%rax)
je 0x1384f
leaq 0x27c1d(%rip), %rdi     # 0x3b3e0
leaq 0x2ff96(%rip), %rsi     # 0x43760
xorl %edx, %edx
callq 0xe541
testl %eax, %eax
je 0x136ee
movl 0x10(%rbx), %r8d
leaq 0x2fb5c(%rip), %rdi     # 0x43340
leaq 0x27bf5(%rip), %rsi     # 0x3b3e0
leaq 0x2ff6e(%rip), %rdx     # 0x43760
movl $0x1, %ecx
callq 0xdbee
leaq 0x229b5(%rip), %rax     # 0x361b8
movq (%rax), %rdi
leaq 0xfaad(%rip), %rsi      # 0x232ba
callq 0x41c0
testl %eax, %eax
je 0x136ee
leaq 0x3115f(%rip), %rbx     # 0x44980
leaq 0x10801(%rip), %rsi     # 0x24029
leaq 0x22b61(%rip), %rdx     # 0x36390
movq %rbx, %rdi
xorl %eax, %eax
callq 0x42a0
movq %rbx, %rdi
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x12500
cmpb $0x0, 0x27b8a(%rip)     # 0x3b3e0
je 0x136ee
leaq 0x27b7d(%rip), %r14     # 0x3b3e0
movq %r14, %rdi
callq 0x4110
cmpb $0x2a, -0x1(%rax,%r14)
je 0x136ee
testb $0x2, (%r12)
jne 0x13934
cmpb $0x0, 0x22b07(%rip)     # 0x36390
movl 0x10(%rbx), %r8d
je 0x13919
cmpl $0x0, 0x27b22(%rip)     # 0x3b3bc
je 0x13919
leaq 0x2fa9d(%rip), %rdi     # 0x43340
leaq 0x27b36(%rip), %rsi     # 0x3b3e0
leaq 0x22adf(%rip), %rdx     # 0x36390
movl $0x1, %ecx
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xd95a
movq 0x22728(%rip), %rax     # 0x35ff8
movq (%rax), %rdi
movl 0x10(%rbx), %edx
movq 0x28(%rbx), %rax
movq 0x18(%rax), %r10
subq $0x8, %rsp
leaq 0x27af7(%rip), %r11     # 0x3b3e0
leaq 0x1162d(%rip), %rsi     # 0x24f1d
leaq 0x2fe69(%rip), %r8      # 0x43760
leaq 0x2fa42(%rip), %r9      # 0x43340
movq %r14, %rcx
xorl %eax, %eax
pushq %r15
pushq 0x18(%r10)
pushq %r11
callq 0x41d0
addq $0x20, %rsp
jmp 0x137a1
leaq 0x2fa20(%rip), %rdi     # 0x43340
leaq 0x27ab9(%rip), %rsi     # 0x3b3e0
movl $0x1, %edx
movl %r8d, %ecx
jmp 0x13737
movq %rbx, %rdi
callq 0x4e6b
jmp 0x13882