// File: /workspace/github_c_makefile_star2_O2/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 0x12af7
movl %edx, %r14d
movq %rsi, %r12
movq %rdi, %r13
movq (%rdi), %rdi
callq 0x6629
movq %rax, %rbx
leaq 0x50(%rax), %r15
movq %r15, %rdi
callq 0x6e1c
movzbl 0x78(%rbx), %eax
cmpl $0x3, %eax
je 0x12ad6
cmpl $0x2, %eax
je 0x12aad
cmpl $0x1, %eax
jne 0x12b16
movl %r14d, -0x2c(%rbp)
movq 0x58(%r13), %rax
testq %rax, %rax
je 0x12b35
movq 0x58(%rax), %r14
testq %r14, %r14
je 0x12b54
leaq -0x40(%rbp), %rdi
callq 0x6e1c
leaq 0x2b1e2(%rip), %rsi     # 0x3dc2b
leaq -0x40(%rbp), %rdi
callq 0x6e99
movq 0x10(%r14), %rax
movq 0x8(%rax), %rsi
movl 0x4(%rax), %edx
leaq -0x40(%rbp), %rdi
movq %rdi, %r14
callq 0x700f
movq %r13, %rdi
callq 0x13558
movq 0x58(%r12), %rsi
testq %rsi, %rsi
leaq 0x2afab(%rip), %rax     # 0x3da2b
cmoveq %rax, %rsi
movq 0x8(%r14), %rdx
testq %rdx, %rdx
cmoveq %rax, %rdx
leaq 0x2b19f(%rip), %r8      # 0x3dc35
movq %r15, %rdi
movl -0x2c(%rbp), %ecx
xorl %eax, %eax
callq 0x739a
movq %r14, %rdi
callq 0x72b9
jmp 0x12ae5
movq 0x58(%r12), %rax
testq %rax, %rax
leaq 0x2af6f(%rip), %rsi     # 0x3da2b
cmovneq %rax, %rsi
leaq 0x2b448(%rip), %rcx     # 0x3df0f
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x739a
jmp 0x12ae5
addq $0x50, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x712e
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2b3c2(%rip), %rdi     # 0x3dec0
leaq 0x2a943(%rip), %rsi     # 0x3d448
leaq 0x2b361(%rip), %rcx     # 0x3de6d
movl $0xe2b, %edx            # imm = 0xE2B
callq 0x30a0
leaq 0x2884c(%rip), %rdi     # 0x3b369
leaq 0x2a924(%rip), %rsi     # 0x3d448
leaq 0x2b342(%rip), %rcx     # 0x3de6d
movl $0xe61, %edx            # imm = 0xE61
callq 0x30a0
leaq 0x2b3b0(%rip), %rdi     # 0x3deec
leaq 0x2a905(%rip), %rsi     # 0x3d448
leaq 0x2b323(%rip), %rcx     # 0x3de6d
movl $0xe33, %edx            # imm = 0xE33
callq 0x30a0
leaq 0x2b3a1(%rip), %rdi     # 0x3defc
leaq 0x2a8e6(%rip), %rsi     # 0x3d448
leaq 0x2b304(%rip), %rcx     # 0x3de6d
movl $0xe35, %edx            # imm = 0xE35
callq 0x30a0