// File: /workspace/github_c_makefile_star2_O0/hsjoihs[P]c-compiler/typecheck_expression.c
// Function: from_name_to_expr
static struct Expr * /* nullable */
from_name_to_expr(struct AnalyzerState *ptr_ps, const char *name)
{
	if (strcmp(name, "__func__") == 0) {
		struct Expr *p_expr = calloc(1, sizeof(struct Expr));
		*p_expr = string_literal(ptr_ps->current_function_name);
		return p_expr;
	}
	if (!is_local_var(&ptr_ps->scope_chain, name)) {
		const struct EnumeratorAndValue *ptr_enum_and_value =
		    get_global_enumerator(&ptr_ps->global_enumerator_list, name);
		if (ptr_enum_and_value) {
			struct Expr expr;
			expr.details.type = INT_TYPE();
			expr.details.true_type = INT_TYPE();
			expr.category = INT_VALUE;
			expr.int_value = ptr_enum_and_value->value;

			struct Expr *p_expr = calloc(1, sizeof(struct Expr));
			*p_expr = expr;
			return p_expr;
		}

		struct Type type;

		if (isElem(ptr_ps->global_vars_type_map, name)) {
			struct Type *ptr_type = lookup(ptr_ps->global_vars_type_map, name);
			type = *ptr_type;
		} else if (isElem(ptr_ps->func_info_map, name)) {
			struct Type *ptr_type = lookup(ptr_ps->func_info_map, name);
			type = *ptr_type;
		} else {
			return 0;
		}

		struct Expr expr;
		struct Type t2 = type;
		if_array_convert_to_ptr_(&t2);

		expr.details.type = t2;
		expr.details.true_type = type;
		expr.category = GLOBAL_VAR_;
		expr.global_var_name = name;

		struct Expr *p_expr = calloc(1, sizeof(struct Expr));
		*p_expr = expr;
		return p_expr;
	} else {
		struct LocalVarInfo info =
		    resolve_name_locally(&ptr_ps->scope_chain, name);

		struct Expr expr;
		struct Type t2 = info.type;
		if_array_convert_to_ptr_(&t2);

		expr.details.type = t2;
		expr.details.true_type = info.type;
		expr.category = LOCAL_VAR_;
		expr.local_var_offset = info.offset;

		struct Expr *p_expr = calloc(1, sizeof(struct Expr));
		*p_expr = expr;
		return p_expr;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x650, %rsp            # imm = 0x650
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq 0xcf20(%rip), %rsi      # 0x1505e
callq 0x10c0
cmpl $0x0, %eax
jne 0x81a2
movl $0x1, %edi
movl $0x100, %esi            # imm = 0x100
callq 0x10b0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x640(%rbp)
movq -0x10(%rbp), %rax
movq 0x98(%rax), %rsi
leaq -0x120(%rbp), %rdi
callq 0x84c0
movq -0x640(%rbp), %rdi
leaq -0x120(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x10e0
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x84a6
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x6550
cmpl $0x0, %eax
jne 0x83eb
movq -0x10(%rbp), %rdi
addq $0x88, %rdi
movq -0x18(%rbp), %rsi
callq 0x65b0
movq %rax, -0x128(%rbp)
cmpq $0x0, -0x128(%rbp)
je 0x82a1
leaq -0x228(%rbp), %rax
movq %rax, -0x650(%rbp)
leaq -0x278(%rbp), %rdi
callq 0xb230
movq -0x650(%rbp), %rdi
leaq -0x278(%rbp), %rsi
movl $0x50, %edx
callq 0x10e0
leaq -0x228(%rbp), %rax
addq $0x50, %rax
movq %rax, -0x648(%rbp)
leaq -0x2c8(%rbp), %rdi
callq 0xb230
movq -0x648(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
movl $0x50, %edx
callq 0x10e0
movl $0x9, -0x188(%rbp)
movq -0x128(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x160(%rbp)
movl $0x1, %edi
movl $0x100, %esi            # imm = 0x100
callq 0x10b0
movq %rax, -0x2d0(%rbp)
movq -0x2d0(%rbp), %rdi
leaq -0x228(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x10e0
movq -0x2d0(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x84a6
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xcc90
cmpl $0x0, %eax
je 0x82e9
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xcc00
movq %rax, -0x328(%rbp)
movq -0x328(%rbp), %rsi
leaq -0x320(%rbp), %rdi
movl $0x50, %edx
callq 0x10e0
jmp 0x8340
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xcc90
cmpl $0x0, %eax
je 0x8331
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xcc00
movq %rax, -0x330(%rbp)
movq -0x330(%rbp), %rsi
leaq -0x320(%rbp), %rdi
movl $0x50, %edx
callq 0x10e0
jmp 0x833e
movq $0x0, -0x8(%rbp)
jmp 0x84a6
jmp 0x8340
leaq -0x480(%rbp), %rdi
leaq -0x320(%rbp), %rsi
movl $0x50, %edx
callq 0x10e0
leaq -0x480(%rbp), %rdi
callq 0xb880
leaq -0x430(%rbp), %rdi
leaq -0x480(%rbp), %rsi
movl $0x50, %edx
callq 0x10e0
leaq -0x430(%rbp), %rdi
addq $0x50, %rdi
leaq -0x320(%rbp), %rsi
movl $0x50, %edx
callq 0x10e0
movl $0x8, -0x390(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x360(%rbp)
movl $0x1, %edi
movl $0x100, %esi            # imm = 0x100
callq 0x10b0
movq %rax, -0x488(%rbp)
movq -0x488(%rbp), %rdi
leaq -0x430(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x10e0
movq -0x488(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x84a6
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x4e0(%rbp), %rdi
callq 0x98b0
leaq -0x4e0(%rbp), %rsi
leaq -0x630(%rbp), %rdi
movl $0x50, %edx
callq 0x10e0
leaq -0x630(%rbp), %rdi
callq 0xb880
leaq -0x5e0(%rbp), %rdi
leaq -0x630(%rbp), %rsi
movl $0x50, %edx
callq 0x10e0
leaq -0x5e0(%rbp), %rdi
addq $0x50, %rdi
leaq -0x4e0(%rbp), %rsi
movl $0x50, %edx
callq 0x10e0
movl $0x7, -0x540(%rbp)
movl -0x490(%rbp), %eax
movl %eax, -0x4f0(%rbp)
movl $0x1, %edi
movl $0x100, %esi            # imm = 0x100
callq 0x10b0
movq %rax, -0x638(%rbp)
movq -0x638(%rbp), %rdi
leaq -0x5e0(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x10e0
movq -0x638(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x650, %rsp            # imm = 0x650
popq %rbp
retq
nopw %cs:(%rax,%rax)