// File: /workspace/github_c_makefile_star2_O2/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, 0x10(%rsp)
movl %ecx, 0xc(%rsp)
cmpb $0x0, (%rdi)
je 0xc325
movq %rsi, %rbx
cmpb $0x0, (%rsi)
je 0xc325
movq %rdx, %r15
movq %rdi, %r14
cmpb $0x2d, (%rdx)
jne 0xc149
cmpb $0x0, 0x1(%r15)
je 0xc325
leaq 0x15e4b(%rip), %rsi     # 0x21f9b
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)
leaq 0x2a8f0(%rip), %rax     # 0x36a68
movl (%rax), %eax
movl %eax, 0x14(%rsp)
leaq 0x28023(%rip), %rax     # 0x341a8
movq (%rax), %rax
movq %rax, 0x20(%rsp)
leaq 0x2d23c(%rip), %r13     # 0x393d0
movq (%r13), %r13
testq %r13, %r13
je 0xc299
movq 0x10(%r13), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x41b0
testl %eax, %eax
jne 0xc290
movq %r14, %rdi
callq 0x4110
movq %rax, %r14
movq %r12, %rdi
callq 0x4110
cmpq %rax, %r14
jne 0xc290
movq 0x8(%r13), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x41b0
testl %eax, %eax
jne 0xc290
movq %r14, %rdi
callq 0x4110
movq %rax, %r14
movq %r15, %rdi
callq 0x4110
cmpq %rax, %r14
jne 0xc290
movq (%r13), %rbp
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x42d0
testq %rax, %rax
je 0xc290
movq %rax, %r14
cmpl $0x0, 0x14(%rsp)
je 0xc22f
movl $0x1, 0x28(%r13)
jmp 0xc240
movq %r15, %rdi
movq 0x20(%rsp), %rsi
callq 0x41b0
testl %eax, %eax
je 0xc225
cmpq %rbx, %r14
je 0xc255
cmpb $0x2a, -0x2(%r14)
jne 0xc290
cmpb $0x20, -0x1(%r14)
je 0xc270
jmp 0xc290
movq %rbp, %rdi
callq 0x4110
movzbl (%r14,%rax), %eax
testl %eax, %eax
je 0xc270
cmpl $0x20, %eax
je 0xc270
cmpl $0x5b, %eax
jne 0xc245
callq 0x42e0
movq (%rax), %rbx
movq %rbp, %rdi
callq 0x4110
movsbq (%r14,%rax), %rax
testb $0x8, (%rbx,%rax,2)
movq 0x18(%rsp), %rbx
je 0xc2c8
addq $0x38, %r13
jmp 0xc194
testb $0x1, 0x8(%rsp)
je 0xc325
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movl 0xc(%rsp), %ecx
movl 0x10(%rsp), %r8d
callq 0xbe70
movl $0x0, 0x8(%rsp)
jmp 0xc171
movq 0x18(%r13), %r14
testq %r14, %r14
je 0xc2f8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x41b0
testl %eax, %eax
je 0xc325
movq %r14, %rdi
callq 0x4110
movq %rax, %r14
movq %rbx, %rdi
callq 0x4110
cmpq %rax, %r14
jae 0xc325
movq %rbx, %rdi
callq 0x4110
leal 0x1(%rax), %edi
callq 0x4739
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