// File: /workspace/github_c_makefile_star2_O3/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 0x1448e
movl %edx, %r14d
movq %rsi, %r12
movq %rdi, %r13
movq (%rdi), %rdi
callq 0x6af9
movq %rax, %rbx
leaq 0x50(%rax), %r15
movq %r15, %rdi
callq 0x7314
movzbl 0x78(%rbx), %eax
cmpl $0x3, %eax
je 0x1446d
cmpl $0x2, %eax
je 0x14444
cmpl $0x1, %eax
jne 0x144ad
movl %r14d, -0x2c(%rbp)
movq 0x58(%r13), %rax
testq %rax, %rax
je 0x144cc
movq 0x58(%rax), %r14
testq %r14, %r14
je 0x144eb
leaq -0x40(%rbp), %rdi
callq 0x7314
leaq 0x2c83b(%rip), %rsi     # 0x40c1b
leaq -0x40(%rbp), %rdi
callq 0x739b
movq 0x10(%r14), %rax
movq 0x8(%rax), %rsi
movl 0x4(%rax), %edx
leaq -0x40(%rbp), %rdi
movq %rdi, %r14
callq 0x7537
movq %r13, %rdi
callq 0x14f0a
movq 0x58(%r12), %rsi
testq %rsi, %rsi
leaq 0x2c604(%rip), %rax     # 0x40a1b
cmoveq %rax, %rsi
movq 0x8(%r14), %rdx
testq %rdx, %rdx
cmoveq %rax, %rdx
leaq 0x2c7f8(%rip), %r8      # 0x40c25
movq %r15, %rdi
movl -0x2c(%rbp), %ecx
xorl %eax, %eax
callq 0x7905
movq %r14, %rdi
callq 0x7812
jmp 0x1447c
movq 0x58(%r12), %rax
testq %rax, %rax
leaq 0x2c5c8(%rip), %rsi     # 0x40a1b
cmovneq %rax, %rsi
leaq 0x2cab2(%rip), %rcx     # 0x40f10
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x7905
jmp 0x1447c
addq $0x50, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x765e
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2ca2c(%rip), %rdi     # 0x40ec1
leaq 0x2bf9c(%rip), %rsi     # 0x40438
leaq 0x2c9cb(%rip), %rcx     # 0x40e6e
movl $0xe2b, %edx            # imm = 0xE2B
callq 0x30a0
leaq 0x29eb5(%rip), %rdi     # 0x3e369
leaq 0x2bf7d(%rip), %rsi     # 0x40438
leaq 0x2c9ac(%rip), %rcx     # 0x40e6e
movl $0xe61, %edx            # imm = 0xE61
callq 0x30a0
leaq 0x2ca1a(%rip), %rdi     # 0x40eed
leaq 0x2bf5e(%rip), %rsi     # 0x40438
leaq 0x2c98d(%rip), %rcx     # 0x40e6e
movl $0xe33, %edx            # imm = 0xE33
callq 0x30a0
leaq 0x2ca0b(%rip), %rdi     # 0x40efd
leaq 0x2bf3f(%rip), %rsi     # 0x40438
leaq 0x2c96e(%rip), %rcx     # 0x40e6e
movl $0xe35, %edx            # imm = 0xE35
callq 0x30a0