// File: /workspace/github_c_makefile_star2_O3/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 0xde0c
movq %rsi, %rbx
cmpb $0x0, (%rsi)
je 0xde0c
movq %rdx, %r15
movq %rdi, %r14
cmpb $0x2d, (%rdx)
jne 0xdc30
cmpb $0x0, 0x1(%r15)
je 0xde0c
leaq 0x16464(%rip), %rsi     # 0x2409b
movq %r14, %rdi
callq 0x41c0
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 0x2d771(%rip), %r13     # 0x3b3d0
testq %r13, %r13
je 0xdd80
leaq 0x2adf9(%rip), %rax     # 0x38a68
movl (%rax), %eax
movl %eax, 0xc(%rsp)
leaq 0x2852c(%rip), %rax     # 0x361a8
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x10(%r13), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x41c0
testl %eax, %eax
jne 0xdd73
movq %r14, %rdi
callq 0x4110
movq %rax, %r14
movq %r12, %rdi
callq 0x4110
cmpq %rax, %r14
jne 0xdd73
movq 0x8(%r13), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x41c0
testl %eax, %eax
jne 0xdd73
movq %r14, %rdi
callq 0x4110
movq %rax, %r14
movq %r15, %rdi
callq 0x4110
cmpq %rax, %r14
jne 0xdd73
movq (%r13), %rbp
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x42d0
testq %rax, %rax
je 0xdd73
movq %rax, %r14
cmpl $0x0, 0xc(%rsp)
je 0xdd12
movl $0x1, 0x28(%r13)
jmp 0xdd23
movq %r15, %rdi
movq 0x20(%rsp), %rsi
callq 0x41c0
testl %eax, %eax
je 0xdd08
cmpq %rbx, %r14
je 0xdd38
cmpb $0x2a, -0x2(%r14)
jne 0xdd73
cmpb $0x20, -0x1(%r14)
je 0xdd53
jmp 0xdd73
movq %rbp, %rdi
callq 0x4110
movzbl (%r14,%rax), %eax
testl %eax, %eax
je 0xdd53
cmpl $0x20, %eax
je 0xdd53
cmpl $0x5b, %eax
jne 0xdd28
callq 0x42e0
movq (%rax), %rbx
movq %rbp, %rdi
callq 0x4110
movsbq (%r14,%rax), %rax
testb $0x8, (%rbx,%rax,2)
movq 0x18(%rsp), %rbx
je 0xddaf
movq 0x38(%r13), %r13
testq %r13, %r13
jne 0xdc84
testb $0x1, 0x8(%rsp)
je 0xde0c
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movl 0x10(%rsp), %ecx
movl 0x14(%rsp), %r8d
callq 0xd95a
movl $0x0, 0x8(%rsp)
jmp 0xdc58
movq 0x18(%r13), %r14
testq %r14, %r14
je 0xdddf
movq %r14, %rdi
movq %rbx, %rsi
callq 0x41c0
testl %eax, %eax
je 0xde0c
movq %r14, %rdi
callq 0x4110
movq %rax, %r14
movq %rbx, %rdi
callq 0x4110
cmpq %rax, %r14
jae 0xde0c
movq %rbx, %rdi
callq 0x4110
leal 0x1(%rax), %edi
callq 0x6321
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