// File: /workspace/github_c_makefile_star2_O0/xemul[P]cylang/declare.c
// Function: try_resolve_symbol
int try_resolve_symbol(struct cy_token *t)
{
	const char *val = t->val, *aux;
	struct cy_type *ret;

	t->v.v_sym = val;

	if (val[0] == '_') {
		if (val[1] == '.')
			/*
			 * this is a _.... construciton which
			 * is valid nested symbol, but requires
			 * additional checking
			 */
			goto sym;

		if (val[1] == '\0') {
			t->typ = &cy_cursor;
			return 1;
		}

		if (val[1] == '_' && val[2] == '\0') {
			t->typ = &cy_curns;
			return 1;
		}

		if (try_resolve_cvalue(t))
			return 1;

		if (try_resolve_stream(t))
			return 1;

		return 0;
	}

	if (!is_alpha(val[0]))
		return 0;

sym:
	ret = &cy_sym;
	aux = val; /* sym len counting */
	for (val++; *val != '\0'; val++) {
		if (val - aux >= MAX_SYM_LEN) {
			show_token_err(t, "Too long symbol");
			return 0;
		}

		if (is_alpha(*val))
			continue;
		if (is_num(*val))
			continue;
		if (*val == '_')
			continue;
		if (*val == '.') {
			aux = val;
			continue;
		}

		return 0;
	}

	t->typ = ret;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5f, %eax
jne 0x4be2
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x2e, %eax
jne 0x4b45
jmp 0x4c00
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x4b6d
movq -0x10(%rbp), %rax
leaq 0xa82b(%rip), %rcx      # 0xf388
movq %rcx, 0x8(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x4cd4
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x5f, %eax
jne 0x4ba2
movq -0x18(%rbp), %rax
movsbl 0x2(%rax), %eax
cmpl $0x0, %eax
jne 0x4ba2
movq -0x10(%rbp), %rax
leaq 0xa80e(%rip), %rcx      # 0xf3a0
movq %rcx, 0x8(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x4cd4
movq -0x10(%rbp), %rdi
callq 0x9290
cmpl $0x0, %eax
je 0x4bbc
movl $0x1, -0x4(%rbp)
jmp 0x4cd4
movq -0x10(%rbp), %rdi
callq 0x9980
cmpl $0x0, %eax
je 0x4bd6
movl $0x1, -0x4(%rbp)
jmp 0x4cd4
movl $0x0, -0x4(%rbp)
jmp 0x4cd4
movq -0x18(%rbp), %rax
movsbl (%rax), %edi
callq 0x4ce0
testb $0x1, %al
jne 0x4bfe
movl $0x0, -0x4(%rbp)
jmp 0x4cd4
jmp 0x4c00
leaq 0xa769(%rip), %rax      # 0xf370
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x4cc1
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
cmpq $0x40, %rax
jl 0x4c5b
movq -0x10(%rbp), %rdi
leaq 0x6553(%rip), %rsi      # 0xb19e
movb $0x0, %al
callq 0x3310
movl $0x0, -0x4(%rbp)
jmp 0x4cd4
movq -0x18(%rbp), %rax
movsbl (%rax), %edi
callq 0x4ce0
testb $0x1, %al
jne 0x4c6d
jmp 0x4c6f
jmp 0x4cb0
movq -0x18(%rbp), %rax
movsbl (%rax), %edi
callq 0x4d30
testb $0x1, %al
jne 0x4c81
jmp 0x4c83
jmp 0x4cb0
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5f, %eax
jne 0x4c91
jmp 0x4cb0
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x4ca7
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x4cb0
movl $0x0, -0x4(%rbp)
jmp 0x4cd4
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x4c1f
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)