// File: /workspace/github_c_makefile_star2_O3/Ihsoh[P]ilang/compiler/frontend/irgen.c
// Function: ir_expr_mul
static void _ir_expr_mul(
	IRGeneratorContext *ctx,
	ResizableString *rstr,
	ResizableString *rstr_result_lhs_ptr,
	_ExprResult *expr_result,
	ParserASTNode *node
) {
	assert(ctx);
	assert(rstr);
	assert(expr_result);
	assert(node);
	assert(node->type == FE_NODE_EXPR_MUL
			|| node->type == FE_NODE_EXPR_MUL_ASSIGN);

	ParserSymbol *func_symbol = ctx->func_symbol;
	assert(func_symbol);

	ParserASTNode *node_type = FE_EXPR_AST_NODE_GET_TYPE_NODE(node);

	ParserASTNode *node_lhs = node->childs[0];
	ParserASTNode *node_rhs = node->childs[1];

	_ExprResult result_lhs;
	_ExprResult result_rhs;
	_ExprResult result_lhs_casted;
	_ExprResult result_rhs_casted;

	_expr_result_init(&result_lhs);
	_expr_result_init(&result_rhs);
	_expr_result_init(&result_lhs_casted);
	_expr_result_init(&result_rhs_casted);

	_ir_expr(ctx, rstr, &result_lhs, node_lhs);
	rstr_append_with_rstr(rstr, &(result_lhs.rstr_for_result_ptr));
	rstr_append_with_rstr(rstr, &(result_lhs.rstr_for_result));

	if (rstr_result_lhs_ptr != NULL) {
		rstr_append_with_rstr(
			rstr_result_lhs_ptr,
			&(result_lhs.rstr_result_ptr)
		);
	}

	_ir_expr(ctx, rstr, &result_rhs, node_rhs);
	rstr_append_with_rstr(rstr, &(result_rhs.rstr_for_result_ptr));
	rstr_append_with_rstr(rstr, &(result_rhs.rstr_for_result));

	_expr_result_cast(
		ctx,
		&result_lhs_casted,
		node_type,
		&result_lhs,
		FE_EXPR_AST_NODE_GET_TYPE_NODE(node_lhs)
	);
	rstr_append_with_rstr(rstr, &(result_lhs_casted.rstr_for_result_ptr));
	rstr_append_with_rstr(rstr, &(result_lhs_casted.rstr_for_result));

	_expr_result_cast(
		ctx,
		&result_rhs_casted,
		node_type,
		&result_rhs,
		FE_EXPR_AST_NODE_GET_TYPE_NODE(node_rhs)
	);
	rstr_append_with_rstr(rstr, &(result_rhs_casted.rstr_for_result_ptr));
	rstr_append_with_rstr(rstr, &(result_rhs_casted.rstr_for_result));

	ResizableString rstr_tmp_label_val;
	rstr_init(&rstr_tmp_label_val);
	_generate_func_tmp_var(
		ctx,
		func_symbol,
		&rstr_tmp_label_val,
		FE_EXPR_AST_NODE_GET_TYPE_NODE(node)
	);

	rstr_appendf(
		&(expr_result->rstr_for_result),
		"mul %s, %s, %s;\n",
		RSTR_CSTR(&rstr_tmp_label_val),
		RSTR_CSTR(&(result_lhs_casted.rstr_result)),
		RSTR_CSTR(&(result_rhs_casted.rstr_result))
	);
	
	_expr_result_set_result(
		expr_result,
		RSTR_CSTR(&rstr_tmp_label_val)
	);

	_expr_result_free(&result_lhs);
	_expr_result_free(&result_rhs);
	_expr_result_free(&result_lhs_casted);
	_expr_result_free(&result_rhs_casted);
	rstr_free(&rstr_tmp_label_val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
testq %rcx, %rcx
je 0x10f99
movq %rsi, %r12
movq %rdi, %r15
movl (%r8), %eax
cmpl $0xe13, %eax            # imm = 0xE13
je 0x10d7d
cmpl $0xeb0, %eax            # imm = 0xEB0
jne 0x10fd7
movq %rcx, -0x50(%rbp)
movq 0x40(%r15), %rax
movq %rax, -0x48(%rbp)
testq %rax, %rax
je 0x10fb8
movq %rdx, %r14
movq 0x48(%r8), %rax
movq %r8, -0x38(%rbp)
movq 0x68(%r8), %rcx
movq %rcx, -0x40(%rbp)
movq (%rax), %r13
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
leaq -0x110(%rbp), %rbx
movq %rbx, %rdi
callq 0xcdbe
leaq -0xd0(%rbp), %rdi
callq 0xcdbe
leaq -0x90(%rbp), %rdi
callq 0xcdbe
leaq -0x160(%rbp), %rdi
callq 0xcdbe
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq 0xdc0b
leaq -0x100(%rbp), %rsi
movq %r12, %rdi
callq 0x769e
movq %r12, %rdi
movq %rbx, %rsi
callq 0x769e
testq %r14, %r14
je 0x10e22
leaq -0xe0(%rbp), %rsi
movq %r14, %rdi
callq 0x769e
leaq -0xd0(%rbp), %rbx
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq -0x30(%rbp), %r14
movq %r14, %rcx
callq 0xdc0b
leaq -0xc0(%rbp), %rsi
movq %r12, %rdi
callq 0x769e
movq %r12, %rdi
movq %rbx, %rsi
callq 0x769e
movq 0x68(%r13), %r8
leaq -0x90(%rbp), %rbx
leaq -0x110(%rbp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq -0x40(%rbp), %r13
movq %r13, %rdx
callq 0xce14
leaq -0x80(%rbp), %rsi
movq %r12, %rdi
callq 0x769e
movq %r12, %rdi
movq %rbx, %rsi
callq 0x769e
movq 0x68(%r14), %r8
leaq -0x160(%rbp), %r14
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0xd0(%rbp), %rcx
callq 0xce14
leaq -0x150(%rbp), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x769e
movq %r12, %rdi
movq %r14, %rsi
movq %r14, %r13
callq 0x769e
leaq -0x120(%rbp), %r12
movq %r12, %rdi
callq 0x7354
movq -0x38(%rbp), %rax
movq 0x68(%rax), %rcx
movq %r15, %rdi
movq -0x48(%rbp), %rsi
movq %r12, %rdx
callq 0x10c3e
movq 0x8(%r12), %rdx
testq %rdx, %rdx
leaq 0x31ffe(%rip), %r14     # 0x42f06
cmoveq %r14, %rdx
leaq -0x80(%rbp), %rax
movq 0x18(%rax), %rcx
testq %rcx, %rcx
cmoveq %r14, %rcx
movq 0x18(%rbx), %r8
testq %r8, %r8
cmoveq %r14, %r8
leaq 0x31388(%rip), %rsi     # 0x422b5
movq -0x50(%rbp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x7945
movq 0x8(%r12), %rsi
testq %rsi, %rsi
cmoveq %r14, %rsi
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x73db
leaq -0x110(%rbp), %rdi
callq 0xd508
leaq -0xd0(%rbp), %rdi
callq 0xd508
leaq -0x90(%rbp), %rdi
callq 0xd508
movq %r13, %rdi
callq 0xd508
movq %r12, %rdi
callq 0x7852
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x30c34(%rip), %rdi     # 0x41bd4
leaq 0x303bd(%rip), %rsi     # 0x41364
leaq 0x31251(%rip), %rcx     # 0x421ff
movl $0x703, %edx            # imm = 0x703
callq 0x30a0
leaq 0x31fa8(%rip), %rdi     # 0x42f67
leaq 0x3039e(%rip), %rsi     # 0x41364
leaq 0x31232(%rip), %rcx     # 0x421ff
movl $0x709, %edx            # imm = 0x709
callq 0x30a0
leaq 0x3128f(%rip), %rdi     # 0x4226d
leaq 0x3037f(%rip), %rsi     # 0x41364
leaq 0x31213(%rip), %rcx     # 0x421ff
movl $0x706, %edx            # imm = 0x706
callq 0x30a0