// File: /workspace/github_c_makefile_star2_O0/nimble-code[P]Modex/Src/xtract.c
// Function: which_var
char *
which_var(char *s)
{	Fcts *g;
	char *x, *y, *z;
	int i;

	if (strlen(s) == 0)
		return (char *) 0;

	for (g = modex_locals; g; g = g->nxt)
		if (strcmp(g->nm, s) == 0
		&&  strcmp(g->tg, fct_name) == 0)
		{	if (Verbose&2)
			printf("		%s -L-> %s %s %s\n",
				s, g->dt, g->tg, g->full?g->full:g->nm);
			goto found;
		}

	for (g = modex_globals; g; g = g->nxt)
		if (strcmp(g->nm, s) == 0)
		{	if (Verbose&2)
			printf("		%s -G-> %s %s %s\n",
				s, g->dt, g->tg, g->full?g->full:g->nm);
			goto found;
		}

	for (g = modex_hidden; g; g = g->nxt)
		if (strcmp(g->nm, s) == 0)
		{	if (Verbose&2)
			printf("		%s -H-> %s %s %s\n",
				s, g->dt, g->tg, g->full?g->full:g->nm);
			goto found;
		}
notfound:
	if (0)	/* could be field in struct - beyond our scope */
	fprintf(stderr, "		%s -?-> not found\n", s);
	return (char *) 0;
found:
	i = 0; z = g->full?g->full:g->nm;
	while (*z) { if (*z++ == '[') i++; }

	if (i != 1	/* can't tell apart multiple indices - yet */
	||  !(z = strrchr(g->full?g->full:g->nm, '['))
	||  !(y = strrchr(g->full?g->full:g->nm, ']'))
	||  !(z < y))
		goto notfound;
	*y = '\0';
	x = (char *) e_malloc(strlen(z+1)+1);
	strcpy(x, z+1);
	*y = ']';
	return x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x40f0
cmpq $0x0, %rax
jne 0xd96b
movq $0x0, -0x8(%rbp)
jmp 0xdd1c
movq 0x3cc2e(%rip), %rax     # 0x4a5a0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xda3e
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x4180
cmpl $0x0, %eax
jne 0xda2b
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x379b7(%rip), %rsi     # 0x45360
callq 0x4180
cmpl $0x0, %eax
jne 0xda2b
leaq 0x3a292(%rip), %rax     # 0x47c4c
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xda26
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xd9fd
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0xda08
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rcx
movq -0x48(%rbp), %rdx
movq -0x50(%rbp), %rsi
movq -0x58(%rbp), %r8
leaq 0x2796c(%rip), %rdi     # 0x3538b
movb $0x0, %al
callq 0x4120
jmp 0xdbcf
jmp 0xda2d
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0xd976
movq 0x3cb53(%rip), %rax     # 0x4a598
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xdaf4
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x4180
cmpl $0x0, %eax
jne 0xdae1
leaq 0x3a1dc(%rip), %rax     # 0x47c4c
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xdadc
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xdab3
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x78(%rbp)
jmp 0xdabe
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x60(%rbp), %rcx
movq -0x68(%rbp), %rdx
movq -0x70(%rbp), %rsi
movq -0x78(%rbp), %r8
leaq 0x278ca(%rip), %rdi     # 0x3539f
movb $0x0, %al
callq 0x4120
jmp 0xdbcf
jmp 0xdae3
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0xda49
movq 0x3ca85(%rip), %rax     # 0x4a580
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xdbc0
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x4180
cmpl $0x0, %eax
jne 0xdbad
leaq 0x3a122(%rip), %rax     # 0x47c4c
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xdbab
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xdb76
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x98(%rbp)
jmp 0xdb84
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x80(%rbp), %rcx
movq -0x88(%rbp), %rdx
movq -0x90(%rbp), %rsi
movq -0x98(%rbp), %r8
leaq 0x2780f(%rip), %rdi     # 0x353b3
movb $0x0, %al
callq 0x4120
jmp 0xdbcf
jmp 0xdbaf
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0xdaff
jmp 0xdbc2
movq $0x0, -0x8(%rbp)
jmp 0xdd1c
movl $0x0, -0x34(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xdbf2
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0xa0(%rbp)
jmp 0xdc00
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpb $0x0, (%rax)
je 0xdc36
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x30(%rbp)
movsbl (%rax), %eax
cmpl $0x5b, %eax
jne 0xdc34
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xdc0b
cmpl $0x1, -0x34(%rbp)
jne 0xdcd4
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xdc5c
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0xa8(%rbp)
jmp 0xdc6a
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rdi
movl $0x5b, %esi
callq 0x4130
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0xdcd4
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xdca1
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0xb0(%rbp)
jmp 0xdcaf
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rdi
movl $0x5d, %esi
callq 0x4130
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0xdcd4
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0xdcd9
jmp 0xdbc2
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
movq -0x30(%rbp), %rdi
addq $0x1, %rdi
callq 0x40f0
addq $0x1, %rax
movl %eax, %edi
callq 0x4a70
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x1, %rsi
callq 0x40a0
movq -0x28(%rbp), %rax
movb $0x5d, (%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax)