// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x490, %rsp            # imm = 0x490
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x458(%rbp)
movq -0x10(%rbp), %rdi
callq 0x40f0
movq %rax, %rcx
movq -0x458(%rbp), %rax
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x20, %eax
jne 0x13589
movq -0x10(%rbp), %rax
movq %rax, -0x460(%rbp)
movq -0x10(%rbp), %rdi
callq 0x40f0
movq %rax, %rcx
movq -0x460(%rbp), %rax
subq $0x1, %rcx
movb $0x0, (%rax,%rcx)
jmp 0x13536
cmpl $0x0, -0x1c(%rbp)
je 0x1359c
movq -0x10(%rbp), %rdi
callq 0xc930
movq %rax, -0x10(%rbp)
movb $0x0, 0x4221d(%rip)     # 0x557c0
movb $0x0, -0x450(%rbp)
movq -0x10(%rbp), %rdi
movl $0x25, %esi
callq 0x4110
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
je 0x13601
movq -0x50(%rbp), %rax
movb $0x0, (%rax)
leaq -0x450(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4250
movq -0x50(%rbp), %rax
movb $0x25, (%rax)
leaq -0x450(%rbp), %rdi
leaq 0x21c93(%rip), %rsi     # 0x35281
callq 0x4250
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x135aa
jmp 0x13603
movq -0x18(%rbp), %rdi
movl $0x25, %esi
callq 0x4110
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
je 0x1365a
movq -0x50(%rbp), %rax
movb $0x0, (%rax)
movq -0x18(%rbp), %rsi
leaq 0x42193(%rip), %rdi     # 0x557c0
callq 0x4250
movq -0x50(%rbp), %rax
movb $0x25, (%rax)
leaq 0x42180(%rip), %rdi     # 0x557c0
leaq 0x21c3a(%rip), %rsi     # 0x35281
callq 0x4250
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x13603
leaq -0x450(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4250
movq -0x18(%rbp), %rsi
leaq 0x4214b(%rip), %rdi     # 0x557c0
callq 0x4250
movq 0x3a607(%rip), %rax     # 0x4dc88
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x137cb
movq -0x28(%rbp), %rax
movq (%rax), %rdi
leaq 0x2329d(%rip), %rsi     # 0x3693b
callq 0x4280
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
je 0x136b4
movq -0x50(%rbp), %rax
movb $0x0, (%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x470(%rbp)
leaq -0x450(%rbp), %rax
movq %rax, -0x468(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rdi
callq 0x40f0
movq -0x470(%rbp), %rdi
movq -0x468(%rbp), %rsi
movq %rax, %rdx
callq 0x4090
cmpl $0x0, %eax
jne 0x1377b
movl $0x0, -0x3c(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x13742
leaq 0x3453c(%rip), %rax     # 0x47c4c
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x13740
leaq 0x31a4f(%rip), %rax     # 0x45170
movq (%rax), %rsi
leaq -0x450(%rbp), %rdx
movq -0x28(%rbp), %rax
movq (%rax), %rcx
leaq 0x23206(%rip), %rdi     # 0x3693f
movb $0x0, %al
callq 0x4120
jmp 0x13779
movq -0x28(%rbp), %rax
movq (%rax), %rdi
callq 0x40f0
movq %rax, -0x478(%rbp)
leaq -0x450(%rbp), %rdi
callq 0x40f0
movq %rax, %rcx
movq -0x478(%rbp), %rax
cmpq %rcx, %rax
je 0x13777
movl $0x1, -0x3c(%rbp)
jmp 0x13779
jmp 0x13782
movl $0x1, -0x3c(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x13798
movq -0x50(%rbp), %rax
movb $0x2e, (%rax)
movq $0x0, -0x50(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x137b0
movq -0x28(%rbp), %rax
movl 0x14(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x14(%rax)
jmp 0x13aab
jmp 0x137b2
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x13685
leaq -0x450(%rbp), %rdi
leaq 0x23c4b(%rip), %rsi     # 0x37424
callq 0x4280
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x13943
cmpl $0x0, -0x1c(%rbp)
je 0x13943
movq -0x48(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x48(%rbp)
movq 0x3a47e(%rip), %rax     # 0x4dc88
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x13941
movq -0x28(%rbp), %rax
movq (%rax), %rdi
leaq 0x23114(%rip), %rsi     # 0x3693b
callq 0x4280
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
je 0x1383d
movq -0x50(%rbp), %rax
movb $0x0, (%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x488(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x480(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rdi
callq 0x40f0
movq -0x488(%rbp), %rdi
movq -0x480(%rbp), %rsi
movq %rax, %rdx
callq 0x4090
cmpl $0x0, %eax
jne 0x13918
movq -0x28(%rbp), %rax
movl 0x14(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x14(%rax)
cmpq $0x0, -0x50(%rbp)
je 0x138e4
leaq 0x343b0(%rip), %rax     # 0x47c4c
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x138c9
leaq 0x318c3(%rip), %rax     # 0x45170
movq (%rax), %rsi
movq -0x48(%rbp), %rdx
movq -0x28(%rbp), %rax
movq (%rax), %rcx
leaq 0x23099(%rip), %rdi     # 0x3695b
movb $0x0, %al
callq 0x4120
cmpq $0x0, -0x50(%rbp)
je 0x138df
movq -0x50(%rbp), %rax
movb $0x2e, (%rax)
movq $0x0, -0x50(%rbp)
jmp 0x13aab
movq -0x28(%rbp), %rax
movq (%rax), %rdi
callq 0x40f0
movq %rax, -0x490(%rbp)
movq -0x48(%rbp), %rdi
callq 0x40f0
movq %rax, %rcx
movq -0x490(%rbp), %rax
cmpq %rcx, %rax
jne 0x13914
jmp 0x13aab
jmp 0x13916
jmp 0x13918
cmpq $0x0, -0x50(%rbp)
je 0x1392e
movq -0x50(%rbp), %rax
movb $0x2e, (%rax)
movq $0x0, -0x50(%rbp)
jmp 0x13930
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x1380e
jmp 0x13943
cmpl $0x0, -0x1c(%rbp)
je 0x13965
leaq 0x342e8(%rip), %rax     # 0x47c38
cmpl $0x0, (%rax)
je 0x13965
leaq 0x41e64(%rip), %rax     # 0x557c0
movq %rax, -0x8(%rbp)
jmp 0x13ab7
movl $0x28, %edi
callq 0x4a70
movq %rax, -0x30(%rbp)
movl 0x36be7(%rip), %ecx     # 0x4a560
movq -0x30(%rbp), %rax
movl %ecx, 0x1c(%rax)
leaq -0x450(%rbp), %rdi
callq 0x40f0
addq $0x1, %rax
movl %eax, %edi
callq 0x4a70
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
leaq -0x450(%rbp), %rsi
callq 0x40a0
leaq 0x41e05(%rip), %rdi     # 0x557c0
callq 0x40f0
addq $0x1, %rax
movl %eax, %edi
callq 0x4a70
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x41ddb(%rip), %rsi     # 0x557c0
callq 0x40a0
movl $0x1, %ecx
subl -0x1c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x10(%rax)
movl -0x1c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x30(%rbp), %rax
movl $0x0, 0x18(%rax)
cmpq $0x0, -0x38(%rbp)
jne 0x13a31
movq 0x3a26c(%rip), %rcx     # 0x4dc88
movq -0x30(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %rax
movq %rax, 0x3a259(%rip)     # 0x4dc88
jmp 0x13a49
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x20(%rax)
cmpl $0x0, -0x1c(%rbp)
je 0x13aa3
leaq 0x34432(%rip), %rax     # 0x47e88
cmpl $0x0, (%rax)
je 0x13aa3
leaq 0x22f15(%rip), %rdi     # 0x36977
movb $0x0, %al
callq 0x4120
movq 0x31560(%rip), %rax     # 0x44fd0
movq (%rax), %rdi
leaq -0x450(%rbp), %rsi
leaq 0x23a3c(%rip), %rdx     # 0x374bd
callq 0xcbb0
movq 0x31543(%rip), %rax     # 0x44fd0
movq (%rax), %rdi
leaq 0x41d29(%rip), %rsi     # 0x557c0
leaq 0x21fb9(%rip), %rdx     # 0x35a57
callq 0xcbb0
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x490, %rsp            # imm = 0x490
popq %rbp
retq
nopw %cs:(%rax,%rax)