// File: /workspace/github_c_makefile_star2_O1/nimble-code[P]Modex/Src/xtract.c
// Function: add_full_local
void
add_full_local(char *s, char *t, char *r, int derived, int ln)
{	Fcts *g;
	char *z;
	char cntr = 0;

	if (strlen(s) == 0
	||  strlen(t) == 0
	||  strcmp(r, "-") == 0)
		return;

if (0) printf("add_full_local <%s> %s %s\n", s, t, r);
	if (strcmp(s, "unsigned unsigned ") == 0)
	{	s += strlen("unsigned ");
	}


tryagain:
	for (g = modex_locals; g; g = g->nxt)
		if (strcmp(g->dt, s) == 0 && strlen(g->dt) == strlen(s)
		&&  strcmp(g->tg, r) == 0 && strlen(g->tg) == strlen(r)
		&& (z = strstr(t, g->nm)))
		{
			if (allprocs
			||  strcmp(r, want) == 0)
				g->wanted = 1;

if (0)			fprintf(stderr, "consider add_full_local <s=%s t=%s r=%s> g->full=%s g->nm=%s {%d} %d\n",
					s, t, r, g->full, g->nm, *(z+strlen(g->nm)), z==t);

			if ((z == t
			&&  (*(z+strlen(g->nm)) == '['
			||   *(z+strlen(g->nm)) == '\0'
			||   *(z+strlen(g->nm)) == ' '))	/* asgn, ival */
			||  (*(z-2) == '*' && *(z-1) == ' '))
			{
				if (isalnum((int) *(z+strlen(g->nm))))
					continue;

				if (g->full
				&&  (strcmp(g->full, t) == 0
				||   strlen(g->full) >= strlen(t)))
					return;
#if 0
			if (g->full)
				fprintf(stderr, "override add_full_local <%s> <with:%s> <%s> (is:%s) nm=%s {%d} %d\n",
					s, t, r, g->full, g->nm, *(z+strlen(g->nm)), z==t);
			else
				fprintf(stderr, "fillin add_full_local <s=%s (%s) t=%s r=%s (%s)> g->nm=%s {%d} %d\n",
					s, g->dt, t, r, g->tg, g->nm, *(z+strlen(g->nm)), z==t);
#endif
				g->full = (char *) e_malloc(strlen(t)+1);
				strcpy(g->full, t);
				return;
			}
		}

if (debug)		fprintf(stderr, "%s: add_full_local not-found: %s %s %s\n", progname, s, t, r);

	if (++cntr == 1)
	{	add_local(s, t, r, derived, ln, 10);
		goto tryagain;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r8d, 0x14(%rsp)
movl %ecx, 0x10(%rsp)
cmpb $0x0, (%rdi)
je 0xdf3f
movq %rsi, %rbx
cmpb $0x0, (%rsi)
je 0xdf3f
movq %rdx, %r15
movq %rdi, %r14
leaq 0x16d48(%rip), %rsi     # 0x24a9b
movq %rdx, %rdi
callq 0x41b0
testl %eax, %eax
je 0xdf3f
leaq 0x17331(%rip), %rsi     # 0x2509b
movq %r14, %rdi
callq 0x41b0
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
leaq (%rcx,%rcx,8), %r12
addq %r14, %r12
movb $0x1, %al
movl %eax, 0x8(%rsp)
movq %rbx, 0x18(%rsp)
movq 0x2e62e(%rip), %r13     # 0x3c3c0
testq %r13, %r13
je 0xdeb3
leaq 0x2bcb6(%rip), %rax     # 0x39a58
movl (%rax), %eax
movl %eax, 0xc(%rsp)
leaq 0x293e9(%rip), %rax     # 0x37198
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x10(%r13), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x41b0
testl %eax, %eax
jne 0xdea6
movq %r14, %rdi
callq 0x4110
movq %rax, %r14
movq %r12, %rdi
callq 0x4110
cmpq %rax, %r14
jne 0xdea6
movq 0x8(%r13), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x41b0
testl %eax, %eax
jne 0xdea6
movq %r14, %rdi
callq 0x4110
movq %rax, %r14
movq %r15, %rdi
callq 0x4110
cmpq %rax, %r14
jne 0xdea6
movq (%r13), %rbp
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x42c0
testq %rax, %rax
je 0xdea6
movq %rax, %r14
cmpl $0x0, 0xc(%rsp)
je 0xde45
movl $0x1, 0x28(%r13)
jmp 0xde56
movq %r15, %rdi
movq 0x20(%rsp), %rsi
callq 0x41b0
testl %eax, %eax
je 0xde3b
cmpq %rbx, %r14
je 0xde6b
cmpb $0x2a, -0x2(%r14)
jne 0xdea6
cmpb $0x20, -0x1(%r14)
je 0xde86
jmp 0xdea6
movq %rbp, %rdi
callq 0x4110
movzbl (%r14,%rax), %eax
testl %eax, %eax
je 0xde86
cmpl $0x20, %eax
je 0xde86
cmpl $0x5b, %eax
jne 0xde5b
callq 0x42d0
movq (%rax), %rbx
movq %rbp, %rdi
callq 0x4110
movsbq (%r14,%rax), %rax
testb $0x8, (%rbx,%rax,2)
movq 0x18(%rsp), %rbx
je 0xdee2
movq 0x38(%r13), %r13
testq %r13, %r13
jne 0xddb7
testb $0x1, 0x8(%rsp)
je 0xdf3f
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movl 0x10(%rsp), %ecx
movl 0x14(%rsp), %r8d
callq 0xda99
movl $0x0, 0x8(%rsp)
jmp 0xdd8b
movq 0x18(%r13), %r14
testq %r14, %r14
je 0xdf12
movq %r14, %rdi
movq %rbx, %rsi
callq 0x41b0
testl %eax, %eax
je 0xdf3f
movq %r14, %rdi
callq 0x4110
movq %rax, %r14
movq %rbx, %rdi
callq 0x4110
cmpq %rax, %r14
jae 0xdf3f
movq %rbx, %rdi
callq 0x4110
leal 0x1(%rax), %edi
callq 0x6469
movq %rax, 0x18(%r13)
movq %rax, %rdi
movq %rbx, %rsi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x40b0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq