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

	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);
	uint8_t type_target = BE_VAR_SYMBOL_GET_TYPE(symbol_target);

	ParserASTNode *node_source_left = node->childs[1];
	ParserASTNode *node_source_right = node->childs[2];

	if (type_target == BE_TYPE_POINTER) {
		MoveIdOrConstexprToRegEx result;
		_move_id_or_constexpr_to_reg_ex(
			ctx,
			_ASM_REG_AX,
			node_source_left,
			&result
		);
		size_t size_target = be_sem_calc_type_size(
			ctx->psrctx, node, result.node_type->childs[0]
		);

		_move_id_or_constexpr_to_reg(
			ctx,
			_ASM_REG_BX,
			node_source_right
		);
		if (size_target > 1) {
			ResizableString rstr_type_size;
			rstr_init(&rstr_type_size);
			_asm_inst_uint_const(
				ctx,
				&rstr_type_size,
				size_target
			);

			_asm_inst_imul_x_x_x(
				ctx,
				ctx->body,
				BE_TYPE_UINT64,
				_ASM_REG_NAME_RBX,
				_ASM_REG_NAME_RBX,
				RSTR_CSTR(&rstr_type_size)
			);

			rstr_free(&rstr_type_size);
		}

		_asm_inst_add_x_x(
			ctx,
			ctx->body,
			BE_TYPE_UINT64,
			_ASM_REG_NAME_RAX,
			_ASM_REG_NAME_RBX
		);

		_asm_inst_mov_sym_x(
			ctx,
			ctx->body,
			symbol_target,
			_ASM_REG_NAME_RAX
		);
	} else if (be_sem_is_integer_type(type_target)) {
		_move_id_or_constexpr_to_reg(
			ctx,
			_ASM_REG_AX,
			node_source_left
		);

		_move_id_or_constexpr_to_reg(
			ctx,
			_ASM_REG_BX,
			node_source_right
		);

		_asm_inst_add_x_x(
			ctx,
			ctx->body,
			BE_TYPE_UINT64,
			_ASM_REG_NAME_RAX,
			_ASM_REG_NAME_RBX
		);

		_asm_inst_mov_sym_x(
			ctx,
			ctx->body,
			symbol_target,
			_asm_inst_reg(ctx, type_target, _ASM_REG_AX)
		);
	} else if (type_target == BE_TYPE_FLOAT) {
		_move_id_or_constexpr_to_xmm_reg(
			ctx,
			_ASM_REG_NAME_XMM0,
			node_source_left
		);

		_move_id_or_constexpr_to_xmm_reg(
			ctx,
			_ASM_REG_NAME_XMM1,
			node_source_right
		);

		_asm_inst_addss_x_x(
			ctx,
			ctx->body,
			_ASM_REG_NAME_XMM0,
			_ASM_REG_NAME_XMM1
		);

		_asm_inst_movss_sym_x(
			ctx,
			ctx->body,
			symbol_target,
			_ASM_REG_NAME_XMM0
		);
	} else if (type_target == BE_TYPE_DOUBLE) {
		_move_id_or_constexpr_to_xmm_reg(
			ctx,
			_ASM_REG_NAME_XMM0,
			node_source_left
		);

		_move_id_or_constexpr_to_xmm_reg(
			ctx,
			_ASM_REG_NAME_XMM1,
			node_source_right
		);

		_asm_inst_addsd_x_x(
			ctx,
			ctx->body,
			_ASM_REG_NAME_XMM0,
			_ASM_REG_NAME_XMM1
		);

		_asm_inst_movsd_sym_x(
			ctx,
			ctx->body,
			symbol_target,
			_ASM_REG_NAME_XMM0
		);
	} else {
		assert(0);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x2d76c
jmp 0x2d78b
leaq 0x529ee(%rip), %rdi     # 0x80161
leaq 0x4d38a(%rip), %rsi     # 0x7ab04
movl $0x1293, %edx           # imm = 0x1293
leaq 0x4f3f1(%rip), %rcx     # 0x7cb77
callq 0x30a0
cmpq $0x0, -0x10(%rbp)
je 0x2d794
jmp 0x2d7b3
leaq 0x48dc1(%rip), %rdi     # 0x7655c
leaq 0x4d362(%rip), %rsi     # 0x7ab04
movl $0x1294, %edx           # imm = 0x1294
leaq 0x4f3c9(%rip), %rcx     # 0x7cb77
callq 0x30a0
movq -0x10(%rbp), %rax
cmpl $0xbe0, (%rax)          # imm = 0xBE0
jne 0x2d7c1
jmp 0x2d7e0
leaq 0x4b240(%rip), %rdi     # 0x78a08
leaq 0x4d335(%rip), %rsi     # 0x7ab04
movl $0x1295, %edx           # imm = 0x1295
leaq 0x4f39c(%rip), %rcx     # 0x7cb77
callq 0x30a0
movq -0x10(%rbp), %rax
cmpl $0x3, 0x44(%rax)
jne 0x2d7ec
jmp 0x2d80b
leaq 0x4994b(%rip), %rdi     # 0x7713e
leaq 0x4d30a(%rip), %rsi     # 0x7ab04
movl $0x1296, %edx           # imm = 0x1296
leaq 0x4f371(%rip), %rcx     # 0x7cb77
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 0x2d828
jmp 0x2d847
leaq 0x48b8e(%rip), %rdi     # 0x763bd
leaq 0x4d2ce(%rip), %rsi     # 0x7ab04
movl $0x1299, %edx           # imm = 0x1299
leaq 0x4f335(%rip), %rcx     # 0x7cb77
callq 0x30a0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x32820
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb 0x30(%rax), %al
movb %al, -0x21(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movzbl -0x21(%rbp), %eax
cmpl $0x10, %eax
jne 0x2d992
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
xorl %esi, %esi
leaq -0x50(%rbp), %rcx
callq 0x33c70
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x40(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rdx
callq 0x4d4f0
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rdx
movl $0x1, %esi
callq 0x334a0
cmpq $0x1, -0x58(%rbp)
jbe 0x2d94d
leaq -0x68(%rbp), %rdi
callq 0x8c90
movq -0x8(%rbp), %rdi
movq -0x58(%rbp), %rdx
leaq -0x68(%rbp), %rsi
callq 0x33b00
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x2d91c
leaq 0x48629(%rip), %rax     # 0x75f3f
movq %rax, -0x80(%rbp)
jmp 0x2d924
movq -0x60(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x70(%rbp), %rsi
movq -0x78(%rbp), %rdi
movq -0x80(%rbp), %r9
movl $0x9, %edx
leaq 0x4ddc3(%rip), %r8      # 0x7b6ff
movq %r8, %rcx
callq 0x37070
leaq -0x68(%rbp), %rdi
callq 0x9310
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
movl $0x9, %edx
leaq 0x4d755(%rip), %rcx     # 0x7b0ba
leaq 0x4dd93(%rip), %r8      # 0x7b6ff
callq 0x33b30
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x20(%rbp), %rdx
leaq 0x4d732(%rip), %rcx     # 0x7b0ba
callq 0x32d40
jmp 0x2db43
movzbl -0x21(%rbp), %edi
callq 0x4da80
testb $0x1, %al
jne 0x2d9a4
jmp 0x2da3f
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
xorl %esi, %esi
callq 0x334a0
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rdx
movl $0x1, %esi
callq 0x334a0
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
movl $0x9, %edx
leaq 0x4d6dd(%rip), %rcx     # 0x7b0ba
leaq 0x4dd1b(%rip), %r8      # 0x7b6ff
callq 0x33b30
movq -0x8(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x8(%rbp), %rdi
xorl %edx, %edx
movzbl -0x21(%rbp), %esi
callq 0x334d0
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq %rax, %rcx
callq 0x32d40
jmp 0x2db41
movzbl -0x21(%rbp), %eax
cmpl $0xa, %eax
jne 0x2dab0
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x49eaf(%rip), %rsi     # 0x77906
callq 0x36060
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rdx
leaq 0x4afbc(%rip), %rsi     # 0x78a27
callq 0x36060
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
leaq 0x49e83(%rip), %rdx     # 0x77906
leaq 0x4af9d(%rip), %rcx     # 0x78a27
callq 0x35e80
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x20(%rbp), %rdx
leaq 0x49e60(%rip), %rcx     # 0x77906
callq 0x35460
jmp 0x2db3f
movzbl -0x21(%rbp), %eax
cmpl $0xb, %eax
jne 0x2db1e
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x49e3e(%rip), %rsi     # 0x77906
callq 0x36060
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rdx
leaq 0x4af4b(%rip), %rsi     # 0x78a27
callq 0x36060
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
leaq 0x49e12(%rip), %rdx     # 0x77906
leaq 0x4af2c(%rip), %rcx     # 0x78a27
callq 0x35f70
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x20(%rbp), %rdx
leaq 0x49def(%rip), %rcx     # 0x77906
callq 0x356e0
jmp 0x2db3d
leaq 0x45935(%rip), %rdi     # 0x7345a
leaq 0x4cfd8(%rip), %rsi     # 0x7ab04
movl $0x1324, %edx           # imm = 0x1324
leaq 0x4f03f(%rip), %rcx     # 0x7cb77
callq 0x30a0
jmp 0x2db3f
jmp 0x2db41
jmp 0x2db43
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)