// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/backend/asmgen_gas64.c
// Function: asm_stat_va_end
static void _asm_stat_va_end(
	ASMGeneratorGas64Context *ctx,
	ParserASTNode *node
) {
	assert(ctx);
	assert(node);
	assert(node->type == BE_NODE_STAT_VA_END);
	assert(node->nchilds == 1);

	ParserASTNode *node_target = node->childs[0];
	assert(node_target->type == BE_NODE_IDENTIFIER);
	ParserSymbol *symbol_target = _get_var_symbol_by_id_node(ctx, node_target);

	_asm_inst_mov_x_x(
		ctx,
		ctx->body,
		BE_TYPE_UINT64,
		_ASM_REG_NAME_RAX,
		RSTR_CSTR(BE_VAR_SYMBOL_GET_CODE_GEN_NAME(symbol_target))
	);

	ResizableString rstr_memref;
	rstr_init(&rstr_memref);
	_asm_inst_memref_base(
		ctx,
		&rstr_memref,
		_ASM_REG_NAME_RAX
	);

	_asm_inst_mov_x_x(
		ctx,
		ctx->body,
		BE_TYPE_UINT64,
		RSTR_CSTR(&rstr_memref),
		_ASM_CONST_0
	);

	rstr_free(&rstr_memref);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x31f49
jmp 0x31f68
leaq 0x4e211(%rip), %rdi     # 0x80161
leaq 0x48bad(%rip), %rsi     # 0x7ab04
movl $0x1b94, %edx           # imm = 0x1B94
leaq 0x4be27(%rip), %rcx     # 0x7dd8a
callq 0x30a0
cmpq $0x0, -0x10(%rbp)
je 0x31f71
jmp 0x31f90
leaq 0x445e4(%rip), %rdi     # 0x7655c
leaq 0x48b85(%rip), %rsi     # 0x7ab04
movl $0x1b95, %edx           # imm = 0x1B95
leaq 0x4bdff(%rip), %rcx     # 0x7dd8a
callq 0x30a0
movq -0x10(%rbp), %rax
cmpl $0xb71, (%rax)          # imm = 0xB71
jne 0x31f9e
jmp 0x31fbd
leaq 0x48295(%rip), %rdi     # 0x7a23a
leaq 0x48b58(%rip), %rsi     # 0x7ab04
movl $0x1b96, %edx           # imm = 0x1B96
leaq 0x4bdd2(%rip), %rcx     # 0x7dd8a
callq 0x30a0
movq -0x10(%rbp), %rax
cmpl $0x1, 0x44(%rax)
jne 0x31fc9
jmp 0x31fe8
leaq 0x4543e(%rip), %rdi     # 0x7740e
leaq 0x48b2d(%rip), %rsi     # 0x7ab04
movl $0x1b97, %edx           # imm = 0x1B97
leaq 0x4bda7(%rip), %rcx     # 0x7dd8a
callq 0x30a0
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x200, (%rax)          # imm = 0x200
jne 0x32005
jmp 0x32024
leaq 0x443b1(%rip), %rdi     # 0x763bd
leaq 0x48af1(%rip), %rsi     # 0x7ab04
movl $0x1b9a, %edx           # imm = 0x1B9A
leaq 0x4bd6b(%rip), %rcx     # 0x7dd8a
callq 0x30a0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x32820
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x58(%rax)
jne 0x32061
leaq 0x43ee4(%rip), %rax     # 0x75f3f
movq %rax, -0x48(%rbp)
jmp 0x3206d
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %r8
movl $0x9, %edx
leaq 0x49035(%rip), %rcx     # 0x7b0ba
callq 0x33720
leaq -0x30(%rbp), %rdi
callq 0x8c90
movq -0x8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq 0x49018(%rip), %rdx     # 0x7b0ba
callq 0x35240
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x320cf
leaq 0x43e76(%rip), %rax     # 0x75f3f
movq %rax, -0x60(%rbp)
jmp 0x320d7
movq -0x28(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x50(%rbp), %rsi
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rcx
movl $0x9, %edx
leaq 0x4497c(%rip), %r8      # 0x76a6b
callq 0x33720
leaq -0x30(%rbp), %rdi
callq 0x9310
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)