// File: /workspace/github_c_makefile_star2_O1/Ihsoh[P]ilang/compiler/backend/asmgen_gas32.c
// Function: instantiate_varsym
static ParserSymbol * _instantiate_varsym(
	ASMGeneratorGas32Context *ctx,
	ParserSymbol * varsym,
	int offset
) {
	assert(varsym);
	assert(BE_VAR_SYMBOL_GET_HAS_CODE_GEN_NAME(varsym));

	ParserSymbol *symbol = parser_clone_symbol(ctx->psrctx, varsym);
	rstr_init(BE_VAR_SYMBOL_GET_CODE_GEN_NAME(symbol));
	
	switch (BE_VAR_SYMBOL_GET_SCOPE_TYPE(symbol)) {
		case BE_VAR_TYPE_GLOBAL: {
			ParserSymbol *cur_func_symbol = ctx->func_symbol;
			assert(cur_func_symbol);
			ParserASTNode *cur_func_name_node = BE_FUNC_SYMBOL_GET_FUNC_NAME_NODE(cur_func_symbol);
			assert(cur_func_name_node);

			ResizableString rstr_label;
			rstr_init(&rstr_label);
			rstr_append_with_cstr(
				&rstr_label,
				_ASM_IP_LABEL_PREFIX
			);
			rstr_append_with_raw(
				&rstr_label,
				cur_func_name_node->token->content,
				cur_func_name_node->token->len
			);

			_asm_get_ip(ctx);

			rstr_appendf(
				BE_VAR_SYMBOL_GET_CODE_GEN_NAME(symbol),
				RSTR_CSTR(BE_VAR_SYMBOL_GET_CODE_GEN_NAME(varsym)),
				RSTR_CSTR(&rstr_label),
				offset,
				_ASM_IP_REG
			);

			rstr_free(&rstr_label);
			break;
		}
		case BE_VAR_TYPE_LOCAL: {
			rstr_appendf(
				BE_VAR_SYMBOL_GET_CODE_GEN_NAME(symbol),
				RSTR_CSTR(BE_VAR_SYMBOL_GET_CODE_GEN_NAME(varsym)),
				offset,
				_ASM_STACK_FRAME_REG
			);
			break;
		}
		case BE_VAR_TYPE_FUNC_PARAM: {
			rstr_append_with_rstr(
				BE_VAR_SYMBOL_GET_CODE_GEN_NAME(symbol),
				BE_VAR_SYMBOL_GET_CODE_GEN_NAME(varsym)
			);
			break;
		}
		default: {
			assert(0);
			return NULL;
		}
	}

	return symbol;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpb $0x0, 0x48(%rsi)
je 0x147a4
movl %edx, %r14d
movq %rsi, %r12
movq %rdi, %r13
movq (%rdi), %rdi
callq 0x6c29
movq %rax, %rbx
leaq 0x50(%rax), %r15
movq %r15, %rdi
callq 0x7508
movzbl 0x78(%rbx), %eax
cmpl $0x3, %eax
je 0x14783
cmpl $0x2, %eax
je 0x1475a
cmpl $0x1, %eax
jne 0x147c3
movl %r14d, -0x2c(%rbp)
movq 0x58(%r13), %rax
testq %rax, %rax
je 0x147e2
movq 0x58(%rax), %r14
testq %r14, %r14
je 0x14801
leaq -0x40(%rbp), %rdi
callq 0x7508
leaq 0x2e565(%rip), %rsi     # 0x42c5b
leaq -0x40(%rbp), %rdi
callq 0x758f
movq 0x10(%r14), %rax
movq 0x8(%rax), %rsi
movl 0x4(%rax), %edx
leaq -0x40(%rbp), %rdi
movq %rdi, %r14
callq 0x7728
movq %r13, %rdi
callq 0x151f1
movq 0x58(%r12), %rsi
testq %rsi, %rsi
leaq 0x2e32e(%rip), %rax     # 0x42a5b
cmoveq %rax, %rsi
movq 0x8(%r14), %rdx
testq %rdx, %rdx
cmoveq %rax, %rdx
leaq 0x2e522(%rip), %r8      # 0x42c65
movq %r15, %rdi
movl -0x2c(%rbp), %ecx
xorl %eax, %eax
callq 0x7af1
movq %r14, %rdi
callq 0x79f8
jmp 0x14792
movq 0x58(%r12), %rax
testq %rax, %rax
leaq 0x2e2f2(%rip), %rsi     # 0x42a5b
cmovneq %rax, %rsi
leaq 0x2e7dc(%rip), %rcx     # 0x42f50
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x7af1
jmp 0x14792
addq $0x50, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x784c
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2e756(%rip), %rdi     # 0x42f01
leaq 0x2dcc6(%rip), %rsi     # 0x42478
leaq 0x2e6f5(%rip), %rcx     # 0x42eae
movl $0xe2b, %edx            # imm = 0xE2B
callq 0x30a0
leaq 0x2bbc3(%rip), %rdi     # 0x4038d
leaq 0x2dca7(%rip), %rsi     # 0x42478
leaq 0x2e6d6(%rip), %rcx     # 0x42eae
movl $0xe61, %edx            # imm = 0xE61
callq 0x30a0
leaq 0x2e744(%rip), %rdi     # 0x42f2d
leaq 0x2dc88(%rip), %rsi     # 0x42478
leaq 0x2e6b7(%rip), %rcx     # 0x42eae
movl $0xe33, %edx            # imm = 0xE33
callq 0x30a0
leaq 0x2e735(%rip), %rdi     # 0x42f3d
leaq 0x2dc69(%rip), %rsi     # 0x42478
leaq 0x2e698(%rip), %rcx     # 0x42eae
movl $0xe35, %edx            # imm = 0xE35
callq 0x30a0