// File: /workspace/github_c_makefile_star2_O0/nimble-code[P]Modex/Src/xtract.c
// Function: map_type
int
map_type(char *s, symentry_t *nmtbl)
{	Fcts *f = (Fcts *) 0;
	int ret_val = 0;	/* 0 = undefined */

	if (nmtbl->kind == ENUM_CONST_ENTRY && is_constant(s))
	{	ret_val = 3;	/* same as hidden */
		goto done;
	}

	if (nmtbl->kind != VARDECL_ENTRY)
		goto shortcut;
	/* else its a typedef, structname, fctname, labelname */

	/* local */
	for (f = modex_locals; f; f = f->nxt)
	{	if (strcmp(s, f->nm) == 0
		&&  strcmp(fct_name, f->tg) == 0)
		{	if (strcmp(fct_name, want) == 0)
				f->wanted = 1;
			if (!imported(s, f->tg, 0))
				ret_val = 3;
			else
				ret_val = 1;
			goto done;
	}	}

	/* global */
	for (f = modex_globals; f; f = f->nxt)
	{	if (strcmp(s, f->nm) == 0)
		{	if (!imported(s, "Global", 0))
				ret_val = 3;
			else
				ret_val = 2;
			goto done;
	}	}
shortcut:
	/* hidden */
	for (f = modex_hidden; f; f = f->nxt)
	{	if (strcmp(f->dt, "Global") != 0	/* structure member */
		&&  strcmp(s, f->nm) == 0)
		{	ret_val = 3;
			goto done;
	}	}

done:
#if 0
	if (visu && check_type && ret_val)
	{	if (f				/* was missing, found by uno 10/18/01 */
		&&  strcmp(f->dt, "int") != 0
		&&  strcmp(f->dt, "int ") != 0
		&&  strcmp(f->dt, "short") != 0
		&&  strcmp(f->dt, "short ") != 0)
		{	fprintf(stderr, "%s: %d: error, return var %s must be int (saw %s)\n",
				progname, f->lno, s, f->dt);
	}	}
#endif
	return ret_val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x4, (%rax)
jne 0x12092
movq -0x8(%rbp), %rdi
callq 0x68d0
cmpl $0x0, %eax
je 0x12092
movl $0x3, -0x1c(%rbp)
jmp 0x12207
movq -0x10(%rbp), %rax
cmpl $0x3, (%rax)
je 0x120a0
jmp 0x121ac
movq 0x384f9(%rip), %rax     # 0x4a5a0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x1214a
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x4180
cmpl $0x0, %eax
jne 0x12137
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x33286(%rip), %rdi     # 0x45360
callq 0x4180
cmpl $0x0, %eax
jne 0x12137
leaq 0x3308d(%rip), %rax     # 0x45178
movq (%rax), %rsi
leaq 0x3326b(%rip), %rdi     # 0x45360
callq 0x4180
cmpl $0x0, %eax
jne 0x1210a
movq -0x18(%rbp), %rax
movl $0x1, 0x28(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
xorl %edx, %edx
callq 0x10430
cmpl $0x0, %eax
jne 0x1212b
movl $0x3, -0x1c(%rbp)
jmp 0x12132
movl $0x1, -0x1c(%rbp)
jmp 0x12207
jmp 0x12139
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x120ab
movq 0x38447(%rip), %rax     # 0x4a598
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x121aa
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x4180
cmpl $0x0, %eax
jne 0x1219a
movq -0x8(%rbp), %rdi
leaq 0x20f31(%rip), %rsi     # 0x330ad
xorl %edx, %edx
callq 0x10430
cmpl $0x0, %eax
jne 0x12191
movl $0x3, -0x1c(%rbp)
jmp 0x12198
movl $0x2, -0x1c(%rbp)
jmp 0x12207
jmp 0x1219c
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x12155
jmp 0x121ac
movq 0x383cd(%rip), %rax     # 0x4a580
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x12205
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x20ee0(%rip), %rsi     # 0x330ad
callq 0x4180
cmpl $0x0, %eax
je 0x121f5
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x4180
cmpl $0x0, %eax
jne 0x121f5
movl $0x3, -0x1c(%rbp)
jmp 0x12207
jmp 0x121f7
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x121b7
jmp 0x12207
movl -0x1c(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq