// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/frontend/irgen.c
// Function: ir_expr_identifier
static bool _ir_expr_identifier(
	IRGeneratorContext *ctx,
	ResizableString *rstr,
	_ExprResult *expr_result,
	ParserASTNode *node
) {
	assert(ctx);
	assert(rstr);
	assert(expr_result);
	assert(node);

	if (node->type != FE_NODE_EXPR_ATOM) {
		return false;
	}

	ParserASTNode *child = node->childs[0];
	if (child->type != FE_NODE_IDENTIFIER) {
		return false;
	}

	ParserSymbol *func_symbol = ctx->func_symbol;
	assert(func_symbol);

	ParserSymbol *symbol = parser_get_symbol_from_node(ctx->psrctx, node, 0, child->token);
	assert(symbol);

	if (symbol->type == FE_SYM_VAR) {
		assert(FE_VAR_SYMBOL_GET_HAS_CODE_GEN_NAME(symbol));
		ResizableString *code_gen_name = FE_VAR_SYMBOL_GET_CODE_GEN_NAME(symbol);

		_expr_result_set_result(expr_result, RSTR_CSTR(code_gen_name));

		ParserASTNode *node_type = FE_VAR_SYMBOL_GET_TYPE_NODE(symbol);

		ResizableString rstr_tmp_label;
		rstr_init(&rstr_tmp_label);
		_generate_func_tmp_ptr_var(ctx, func_symbol, &rstr_tmp_label, node_type);

		rstr_appendf(
			&(expr_result->rstr_for_result_ptr),
			"ref %s, %s;\n",
			RSTR_CSTR(&rstr_tmp_label),
			RSTR_CSTR(code_gen_name)
		);

		_expr_result_set_result_ptr(expr_result, RSTR_CSTR(&rstr_tmp_label));

		rstr_free(&rstr_tmp_label);
	} else if (symbol->type == FE_SYM_FUNC) {
		ResizableString rstr_id;
		rstr_init(&rstr_id);
		_ir_identifier_name(ctx, &rstr_id, child);

		_expr_result_set_result(expr_result, RSTR_CSTR(&rstr_id));
		_expr_result_set_result_ptr(expr_result, RSTR_CSTR(&rstr_id));

		rstr_free(&rstr_id);
	} else {
		assert(0);
	}

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x140d4
jmp 0x140f3
leaq 0x6847b(%rip), %rdi     # 0x7c556
leaq 0x602b2(%rip), %rsi     # 0x74394
movl $0x38f, %edx            # imm = 0x38F
leaq 0x60cd2(%rip), %rcx     # 0x74dc0
callq 0x30a0
cmpq $0x0, -0x18(%rbp)
je 0x140fc
jmp 0x1411b
leaq 0x5ea0b(%rip), %rdi     # 0x72b0e
leaq 0x6028a(%rip), %rsi     # 0x74394
movl $0x390, %edx            # imm = 0x390
leaq 0x60caa(%rip), %rcx     # 0x74dc0
callq 0x30a0
cmpq $0x0, -0x20(%rbp)
je 0x14124
jmp 0x14143
leaq 0x60ae8(%rip), %rdi     # 0x74c13
leaq 0x60262(%rip), %rsi     # 0x74394
movl $0x391, %edx            # imm = 0x391
leaq 0x60c82(%rip), %rcx     # 0x74dc0
callq 0x30a0
cmpq $0x0, -0x28(%rbp)
je 0x1414c
jmp 0x1416b
leaq 0x61e80(%rip), %rdi     # 0x75fd3
leaq 0x6023a(%rip), %rsi     # 0x74394
movl $0x392, %edx            # imm = 0x392
leaq 0x60c5a(%rip), %rcx     # 0x74dc0
callq 0x30a0
movq -0x28(%rbp), %rax
cmpl $0xee0, (%rax)          # imm = 0xEE0
je 0x14180
movb $0x0, -0x1(%rbp)
jmp 0x1447a
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x200, (%rax)          # imm = 0x200
je 0x141a4
movb $0x0, -0x1(%rbp)
jmp 0x1447a
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x141b9
jmp 0x141d8
leaq 0x61fb3(%rip), %rdi     # 0x76173
leaq 0x601cd(%rip), %rsi     # 0x74394
movl $0x39e, %edx            # imm = 0x39E
leaq 0x60bed(%rip), %rcx     # 0x74dc0
callq 0x30a0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rcx
xorl %edx, %edx
callq 0x82f0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x141ff
jmp 0x1421e
leaq 0x61f72(%rip), %rdi     # 0x76178
leaq 0x60187(%rip), %rsi     # 0x74394
movl $0x3a1, %edx            # imm = 0x3A1
leaq 0x60ba7(%rip), %rcx     # 0x74dc0
callq 0x30a0
movq -0x40(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x143a3
movq -0x40(%rbp), %rax
testb $0x1, 0x48(%rax)
je 0x14237
jmp 0x14256
leaq 0x61fae(%rip), %rdi     # 0x761ec
leaq 0x6014f(%rip), %rsi     # 0x74394
movl $0x3a4, %edx            # imm = 0x3A4
leaq 0x60b6f(%rip), %rcx     # 0x74dc0
callq 0x30a0
movq -0x40(%rbp), %rax
addq $0x30, %rax
addq $0x20, %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x48(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x14286
leaq 0x63635(%rip), %rax     # 0x778b5
movq %rax, -0x80(%rbp)
jmp 0x14292
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x78(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x1a6c0
movq -0x40(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x50(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x8c90
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x50(%rbp), %rcx
leaq -0x60(%rbp), %rdx
callq 0x1a740
movq -0x20(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x142ef
leaq 0x635cf(%rip), %rax     # 0x778b5
movq %rax, -0x90(%rbp)
jmp 0x142fa
movq -0x58(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x48(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x14323
leaq 0x6359b(%rip), %rax     # 0x778b5
movq %rax, -0xa0(%rbp)
jmp 0x14332
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rdx
movq -0x88(%rbp), %rdi
movq -0xa0(%rbp), %rcx
leaq 0x60ad5(%rip), %rsi     # 0x74e23
movb $0x0, %al
callq 0x94d0
movq -0x20(%rbp), %rax
movq %rax, -0xa8(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x14377
leaq 0x63547(%rip), %rax     # 0x778b5
movq %rax, -0xb0(%rbp)
jmp 0x14382
movq -0x58(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xa8(%rbp), %rdi
movq -0xb0(%rbp), %rsi
callq 0x1a880
leaq -0x60(%rbp), %rdi
callq 0x9310
jmp 0x14476
movq -0x40(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x14455
leaq -0x70(%rbp), %rdi
callq 0x8c90
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq -0x70(%rbp), %rsi
callq 0x10be0
movq -0x20(%rbp), %rax
movq %rax, -0xb8(%rbp)
cmpq $0x0, -0x68(%rbp)
jne 0x143ec
leaq 0x634d2(%rip), %rax     # 0x778b5
movq %rax, -0xc0(%rbp)
jmp 0x143f7
movq -0x68(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0xb8(%rbp), %rdi
movq -0xc0(%rbp), %rsi
callq 0x1a6c0
movq -0x20(%rbp), %rax
movq %rax, -0xc8(%rbp)
cmpq $0x0, -0x68(%rbp)
jne 0x1442c
leaq 0x63492(%rip), %rax     # 0x778b5
movq %rax, -0xd0(%rbp)
jmp 0x14437
movq -0x68(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xc8(%rbp), %rdi
movq -0xd0(%rbp), %rsi
callq 0x1a880
leaq -0x70(%rbp), %rdi
callq 0x9310
jmp 0x14474
leaq 0x5dfff(%rip), %rdi     # 0x7245b
leaq 0x5ff31(%rip), %rsi     # 0x74394
movl $0x3c3, %edx            # imm = 0x3C3
leaq 0x60951(%rip), %rcx     # 0x74dc0
callq 0x30a0
jmp 0x14476
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax,%rax)