// File: /workspace/github_c_makefile_star2_O1/nimble-code[P]Modex/Src/xtract.c
// Function: look_lut
static char *
look_lut(char *R, char *T, int ihit)
{	Cache *c, *d, *lc = (Cache *) 0;
	int m; char *y, *z = NULL;
	char r[1024];
	static char t[2048];	/* can be returned */

// if (strstr(R, "printf")) printf("LOOK_LUT %s %s %d\n", R, T, ihit);

	while (R[strlen(R)-1] == ' ')
		R[strlen(R)-1] = '\0';

	if (ihit) R = rm_decor(R);

	r[0] = t[0] = '\0';
	while ((z = strchr(R, '%')) != NULL)
	{	*z = '\0';
		strcat(r, R);
		*z = '%';
		strcat(r, EnCode);
		R = z+1;
	}
	while ((z = strchr(T, '%')) != NULL)
	{	*z = '\0';
		strcat(t, T);
		*z = '%';
		strcat(t, EnCode);
		T = z+1;
	}
	strcat(r, R);
	strcat(t, T);

	for (c = cache; c; lc = c, c = c->nxt)
	{
// a regular expression match on c->s would go here
		if ((z = strstr(c->s, "...")) != NULL)
		{	*z = '\0';
		}
		if (strncmp(c->s, r, strlen(c->s)) == 0)
		{	m = 0;
			if (z)
			{	if (Verbose&2)
				printf("%s: prefix match1 %s -> %s\n",
					progname, r, c->s);
			} else if (strlen(c->s) != strlen(r))
			{	m = 1;
			}
		} else
		{	m = 1;
		}

		if (z)
		{	*z = '.';
			z = NULL;
		}

		if (m == 0)
		{	c->hit++;
			goto done;
	}	}
// if (strstr(R,"printf")) printf("--<<%p>>\n", c);
#if 1
	y = strstr(r, ": ");
	if (y && ihit)
	{	y += strlen(": ");
		for (c = cache; c; c = c->nxt)
		{
// a regular expression match on c->s would go here
			if ((z = strstr(c->s, "...")) != NULL)
			{	*z = '\0';
			}
			if (strncmp(c->s, y, strlen(c->s)) == 0)
			{	c->hit++;
				if (z)
				{	if (Verbose&2)
					printf("%s: prefix match2 %s -> %s\n",
						progname, y, c->s);
					if (z) { *z = '.'; z = NULL; }

// if (strstr(R,"printf")) printf("--oh no\n");
					goto done;
				} else if (strlen(c->s) == strlen(y))
				{
// if (strstr(R,"printf")) printf("--Bingo\n");
					goto done;
			}	}
			if (z)
			{	*z = '.';
				z = NULL;
	}	}	}
#endif
// if (strstr(R,"printf")) printf("--A\n");

	if (ihit && allprocs)	/* avoid out-of-context matches */
	{
// if (strstr(R, "printf")) printf("R1	%s\n", t);
		return t;
	}

	d = (Cache *) e_malloc(sizeof(Cache));
	d->level = Down;
	d->s = (char *) e_malloc(strlen(r)+1);
	strcpy(d->s, r);
	d->t = (char *) e_malloc(strlen(t)+1);
	strcpy(d->t, t);
	d->udef = 1-ihit;	/* this field cannot change */
	d->hit = ihit;	/* this field can change */
	d->printed = 0;

	if (!lc)
	{	d->nxt = cache;
		cache = d;
// printf("Addded to cache1 <%s> <%s>\n", r, t);
	} else
	{	d->nxt = c;
		lc->nxt = d;
// printf("Addded to cache2 <%s> <%s>\n", r, t);
	}

	if (ihit && omissions)
	{	printf("Omission: ");
		handle_special(stdout, r, "\t");
		handle_special(stdout, t, "\n");
	}
	c = d;
done:
// if (strstr(R, "printf")) printf("R2	%s\n", c->t);
	return c->t;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
callq 0x4110
cmpb $0x20, -0x1(%r14,%rax)
jne 0x10c30
leaq -0x1(%r14), %rbx
leaq (%r14,%rax), %rcx
decq %rcx
movb $0x0, (%rcx)
movq %r14, %rdi
callq 0x4110
leaq (%rbx,%rax), %rcx
cmpb $0x20, -0x1(%r14,%rax)
je 0x10c19
testl %ebp, %ebp
je 0x10c3f
movq %r14, %rdi
callq 0xc296
movq %rax, %r14
xorl %eax, %eax
movb %al, 0x36999(%rip)      # 0x475e0
movb %al, 0x10(%rsp)
movq %r14, %rdi
movl $0x25, %esi
callq 0x4130
testq %rax, %rax
je 0x10ca9
movq %rax, %r12
leaq 0x10(%rsp), %rbx
movb $0x0, (%r12)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4280
movb $0x25, (%r12)
movq %rbx, %rdi
callq 0x4110
movups 0x14390(%rip), %xmm0    # 0x25019
movups %xmm0, 0x10(%rsp,%rax)
movq %r12, %r14
incq %r14
movq %r14, %rdi
movl $0x25, %esi
callq 0x4130
movq %rax, %r12
testq %rax, %rax
jne 0x10c65
movq %r15, %rdi
movl $0x25, %esi
callq 0x4130
testq %rax, %rax
je 0x10d08
movq %rax, %r12
leaq 0x3691b(%rip), %rbx     # 0x475e0
movb $0x0, (%r12)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4280
movb $0x25, (%r12)
movq %rbx, %rdi
callq 0x4110
movups 0x14330(%rip), %xmm0    # 0x25019
movups %xmm0, (%rax,%rbx)
movq %r12, %r15
incq %r15
movq %r15, %rdi
movl $0x25, %esi
callq 0x4130
movq %rax, %r12
testq %rax, %rax
jne 0x10cc5
movl %ebp, 0xc(%rsp)
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x4280
leaq 0x368c0(%rip), %rdi     # 0x475e0
movq %r15, %rsi
callq 0x4280
movq 0x2ed79(%rip), %rax     # 0x3faa8
testq %rax, %rax
je 0x10de3
leaq 0x15813(%rip), %r15     # 0x26552
leaq 0x10(%rsp), %r12
movq %rax, %r14
movq (%rax), %rdi
movq %r15, %rsi
callq 0x42c0
movq %rax, %rbp
testq %rax, %rax
je 0x10d5e
movb $0x0, (%rbp)
movq (%r14), %rbx
movq %rbx, %rdi
callq 0x4110
movq %rax, %r13
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x40a0
testl %eax, %eax
je 0x10d9e
xorl %r13d, %r13d
testq %rbp, %rbp
je 0x10d8a
movb $0x2e, (%rbp)
testb %r13b, %r13b
jne 0x10f41
movq 0x20(%r14), %rax
testq %rax, %rax
jne 0x10d44
jmp 0x10de6
testq %rbp, %rbp
je 0x10dd2
movb $0x1, %r13b
leaq 0x28cbf(%rip), %rax     # 0x39a6c
testb $0x2, (%rax)
je 0x10d81
leaq 0x263d7(%rip), %rax     # 0x37190
movq (%rax), %rsi
leaq 0x15793(%rip), %rdi     # 0x26556
movq %r12, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4140
jmp 0x10d81
movq %r12, %rdi
callq 0x4110
cmpq %rax, %r13
sete %r13b
jmp 0x10d81
xorl %r14d, %r14d
cmpl $0x0, 0xc(%rsp)
sete %bl
leaq 0x16214(%rip), %rsi     # 0x27009
leaq 0x10(%rsp), %rdi
callq 0x42c0
movq %rax, %r12
testq %rax, %rax
sete %al
orb %bl, %al
jne 0x10e98
movq 0x2ec91(%rip), %r15     # 0x3faa8
testq %r15, %r15
je 0x10e98
addq $0x2, %r12
leaq 0x1572b(%rip), %rbp     # 0x26552
movq (%r15), %rdi
movq %rbp, %rsi
callq 0x42c0
movq %rax, %r13
testq %rax, %rax
je 0x10e3f
movb $0x0, (%r13)
movq (%r15), %rbx
movq %rbx, %rdi
callq 0x4110
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x40a0
testl %eax, %eax
jne 0x10e85
incl 0x14(%r15)
testq %r13, %r13
jne 0x10fb3
movq %rbx, %rdi
callq 0x4110
movq %rax, %rbx
movq %r12, %rdi
callq 0x4110
cmpq %rax, %rbx
je 0x10fe2
testq %r13, %r13
je 0x10e8f
movb $0x2e, (%r13)
movq 0x20(%r15), %r15
testq %r15, %r15
jne 0x10e27
movl 0xc(%rsp), %ebp
testl %ebp, %ebp
leaq 0x3673b(%rip), %rax     # 0x475e0
je 0x10eb7
leaq 0x28baa(%rip), %rcx     # 0x39a58
cmpl $0x0, (%rcx)
jne 0x10fe6
movl $0x28, %edi
callq 0x6469
movq %rax, %r15
movl 0x2b4b6(%rip), %eax     # 0x3c380
movl %eax, 0x1c(%r15)
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x4110
leal 0x1(%rax), %edi
callq 0x6469
movq %rax, (%r15)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x40b0
leaq 0x366e8(%rip), %rbx     # 0x475e0
movq %rbx, %rdi
callq 0x4110
leal 0x1(%rax), %edi
callq 0x6469
movq %rax, 0x8(%r15)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x40b0
movl $0x1, %eax
subl %ebp, %eax
movl %eax, 0x10(%r15)
movl %ebp, 0x14(%r15)
movl $0x0, 0x18(%r15)
testq %r14, %r14
je 0x10f4d
movq $0x0, 0x20(%r15)
addq $0x20, %r14
jmp 0x10f5f
incl 0x14(%r14)
movq %r14, %r15
jmp 0x10fe2
leaq 0x2eb54(%rip), %r14     # 0x3faa8
movq 0x2eb4d(%rip), %rax     # 0x3faa8
movq %rax, 0x20(%r15)
movq %r15, (%r14)
testl %ebp, %ebp
je 0x10fe2
leaq 0x28d3b(%rip), %rax     # 0x39ca8
cmpl $0x0, (%rax)
je 0x10fe2
leaq 0x15615(%rip), %rdi     # 0x2658e
xorl %eax, %eax
callq 0x4140
movq 0x26049(%rip), %rbx     # 0x36fd0
movq (%rbx), %rdi
leaq 0x16102(%rip), %rdx     # 0x27093
leaq 0x10(%rsp), %rsi
callq 0xc45d
movq (%rbx), %rdi
leaq 0x3663b(%rip), %rsi     # 0x475e0
leaq 0x147be(%rip), %rdx     # 0x2576a
callq 0xc45d
jmp 0x10fe2
leaq 0x28ab2(%rip), %rax     # 0x39a6c
testb $0x2, (%rax)
je 0x10fdd
leaq 0x261ca(%rip), %rax     # 0x37190
movq (%rax), %rsi
leaq 0x155a2(%rip), %rdi     # 0x26572
movq %r12, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4140
movb $0x2e, (%r13)
movq 0x8(%r15), %rax
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq