// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
leaq 0x32289(%rip), %rdi     # 0x48550
callq 0x40f0
cmpq $0x2, %rax
jbe 0x1632f
leaq 0x32277(%rip), %rdi     # 0x48550
callq 0x40f0
subq $0x2, %rax
leaq 0x32267(%rip), %rdi     # 0x48550
addq %rax, %rdi
leaq 0x1fd36(%rip), %rsi     # 0x36029
callq 0x4280
cmpq $0x0, %rax
jne 0x1632a
leaq 0x3224b(%rip), %rdi     # 0x48550
callq 0x40f0
subq $0x1, %rax
leaq 0x3223b(%rip), %rdi     # 0x48550
addq %rax, %rdi
leaq 0x2061e(%rip), %rsi     # 0x3693d
callq 0x4280
cmpq $0x0, %rax
je 0x1632f
jmp 0x16842
cmpl $0x0, 0x3bbaa(%rip)     # 0x51ee0
je 0x1633d
jmp 0x16842
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x1641a
cmpl $0x0, 0x34235(%rip)     # 0x4a588
je 0x163b3
movq 0x2ec9c(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edx
movq -0x20(%rbp), %rcx
movl 0x3421b(%rip), %r11d    # 0x4a58c
movl 0x34218(%rip), %r10d    # 0x4a590
movl 0x34216(%rip), %eax     # 0x4a594
leaq 0x1ff31(%rip), %rsi     # 0x362b6
leaq 0x3c184(%rip), %r8      # 0x52510
leaq 0x3c59d(%rip), %r9      # 0x52930
leaq 0x34216(%rip), %rbx     # 0x4a5b0
movq %rbx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movb $0x0, %al
callq 0x4190
movq 0x341de(%rip), %rax     # 0x4a598
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x163f9
movq -0x18(%rbp), %rax
cmpl $0x0, 0x24(%rax)
jne 0x163e9
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x4180
cmpl $0x0, %eax
jne 0x163e9
jmp 0x164bf
jmp 0x163eb
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x163be
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
leaq 0x1cca2(%rip), %rdi     # 0x330ad
movl $0x1, %edx
callq 0xd150
jmp 0x16842
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
cmpl $0x5, (%rax)
je 0x16434
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
cmpl $0x6, (%rax)
jne 0x16439
jmp 0x16842
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x12050
movl %eax, %ecx
movl %ecx, -0x224(%rbp)
subl $0x1, %eax
je 0x16473
jmp 0x16459
movl -0x224(%rbp), %eax
subl $0x2, %eax
je 0x164bd
jmp 0x16466
movl -0x224(%rbp), %eax
subl $0x3, %eax
je 0x164d0
jmp 0x164d7
jmp 0x16475
leaq 0x2ed0c(%rip), %rax     # 0x45188
movq (%rax), %rdi
leaq 0x1df68(%rip), %rsi     # 0x343ee
callq 0x4180
cmpl $0x0, %eax
je 0x164b8
leaq 0x3d6b9(%rip), %rdi     # 0x53b50
leaq 0x1edf3(%rip), %rsi     # 0x35291
leaq 0x2eebb(%rip), %rdx     # 0x45360
movb $0x0, %al
callq 0x4260
leaq 0x3d69d(%rip), %rdi     # 0x53b50
callq 0x15790
jmp 0x16842
jmp 0x164bf
leaq 0x1edd3(%rip), %rdi     # 0x35299
callq 0x15790
jmp 0x16842
jmp 0x164d2
jmp 0x16842
cmpl $0x0, 0x340ae(%rip)     # 0x4a58c
je 0x164e5
jmp 0x16842
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movswl 0x20(%rax), %eax
cmpl $0x3, %eax
jge 0x165bd
leaq -0x220(%rbp), %rdi
leaq 0x3c428(%rip), %rsi     # 0x52930
callq 0x40a0
leaq 0x3c41c(%rip), %rdi     # 0x52930
leaq 0x20fa3(%rip), %rsi     # 0x374be
callq 0x40a0
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rsi
leaq 0x1cb7a(%rip), %rdi     # 0x330ad
callq 0x161e0
leaq 0x3bfd1(%rip), %rdi     # 0x52510
leaq 0x1fda7(%rip), %rsi     # 0x362ed
callq 0x4180
cmpl $0x0, %eax
jne 0x16555
jmp 0x16842
leaq -0x220(%rbp), %rsi
leaq 0x3c3cd(%rip), %rdi     # 0x52930
callq 0x40a0
leaq 0x34041(%rip), %rdi     # 0x4a5b0
leaq 0x1cb37(%rip), %rsi     # 0x330ad
xorl %edx, %edx
callq 0x10430
cmpl $0x0, %eax
jne 0x16587
jmp 0x164d2
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
cmpl $0x1, (%rax)
jne 0x16599
jmp 0x164d2
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
leaq 0x3bf69(%rip), %rdi     # 0x52510
leaq 0x34002(%rip), %rsi     # 0x4a5b0
movl $0x1, %edx
callq 0xd6f0
jmp 0x164bf
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
cmpq $0x0, 0x18(%rax)
je 0x1683e
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x18(%rax), %rax
cmpq $0x0, 0x18(%rax)
je 0x1683e
cmpl $0x0, 0x33fa2(%rip)     # 0x4a590
je 0x16605
leaq 0x3c339(%rip), %rdi     # 0x52930
leaq 0x2ed62(%rip), %rsi     # 0x45360
callq 0x40a0
jmp 0x16621
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rsi
leaq 0x3c314(%rip), %rdi     # 0x52930
callq 0x40a0
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x10(%rax), %rsi
leaq 0x1f723(%rip), %rdi     # 0x35d57
callq 0x161e0
leaq 0x3160c(%rip), %rax     # 0x47c4c
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x166a7
movq 0x2e9a7(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edx
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %r10
leaq 0x1fc7f(%rip), %rsi     # 0x362f5
leaq 0x3c2b3(%rip), %r8      # 0x52930
leaq 0x3be8c(%rip), %r9      # 0x52510
leaq 0x33f25(%rip), %r11     # 0x4a5b0
leaq 0x31ebe(%rip), %rax     # 0x48550
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0x4190
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rdi
leaq 0x1e596(%rip), %rsi     # 0x34c54
callq 0x4180
cmpl $0x0, %eax
je 0x16713
leaq 0x33ee1(%rip), %rdi     # 0x4a5b0
leaq 0x3c25a(%rip), %rsi     # 0x52930
xorl %edx, %edx
callq 0x10430
cmpl $0x0, %eax
jne 0x166e7
jmp 0x164d2
movq -0x10(%rbp), %rax
movl 0x10(%rax), %r8d
leaq 0x3be1a(%rip), %rdi     # 0x52510
leaq 0x33eb3(%rip), %rsi     # 0x4a5b0
leaq 0x3c22c(%rip), %rdx     # 0x52930
movl $0x1, %ecx
callq 0xf560
jmp 0x16475
leaq 0x33e96(%rip), %rdi     # 0x4a5b0
leaq 0x20d9d(%rip), %rsi     # 0x374be
callq 0x4180
cmpl $0x0, %eax
je 0x1683c
leaq 0x33e7a(%rip), %rdi     # 0x4a5b0
callq 0x40f0
movq %rax, %rcx
subq $0x1, %rcx
leaq 0x33e67(%rip), %rax     # 0x4a5b0
movsbl (%rax,%rcx), %eax
cmpl $0x2a, %eax
je 0x1683c
cmpl $0x0, 0x33e2b(%rip)     # 0x4a588
jne 0x16770
leaq 0x314e6(%rip), %rax     # 0x47c4c
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x167d1
movq 0x2e881(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edx
movl 0x33e04(%rip), %r11d    # 0x4a58c
movl 0x33e01(%rip), %r10d    # 0x4a590
movl 0x33dff(%rip), %eax     # 0x4a594
leaq 0x1fb95(%rip), %rsi     # 0x36331
leaq 0x3bd6d(%rip), %rcx     # 0x52510
leaq 0x33e06(%rip), %r8      # 0x4a5b0
leaq 0x3c17f(%rip), %r9      # 0x52930
leaq 0x2eba8(%rip), %rbx     # 0x45360
movq %rbx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
movb $0x0, %al
callq 0x4190
leaq 0x2eb88(%rip), %rdi     # 0x45360
callq 0x40f0
cmpq $0x0, %rax
jbe 0x1681b
cmpl $0x0, 0x33da6(%rip)     # 0x4a590
je 0x1681b
movq -0x10(%rbp), %rax
movl 0x10(%rax), %r8d
leaq 0x3bd15(%rip), %rdi     # 0x52510
leaq 0x33dae(%rip), %rsi     # 0x4a5b0
leaq 0x2eb57(%rip), %rdx     # 0x45360
movl $0x1, %ecx
movl $0x32, %r9d
callq 0xf1c0
jmp 0x1683a
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
leaq 0x3bce7(%rip), %rdi     # 0x52510
leaq 0x33d80(%rip), %rsi     # 0x4a5b0
movl $0x1, %edx
callq 0xd150
jmp 0x1683c
jmp 0x16842
jmp 0x16840
jmp 0x16842
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %rbp
retq
nopl (%rax)