// File: /workspace/github_c_makefile_star2_O0/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
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1ad98
jmp 0x1adb7
leaq 0x617b7(%rip), %rdi     # 0x7c556
leaq 0x595ee(%rip), %rsi     # 0x74394
movl $0x701, %edx            # imm = 0x701
leaq 0x5a63e(%rip), %rcx     # 0x753f0
callq 0x30a0
cmpq $0x0, -0x10(%rbp)
je 0x1adc0
jmp 0x1addf
leaq 0x57d47(%rip), %rdi     # 0x72b0e
leaq 0x595c6(%rip), %rsi     # 0x74394
movl $0x702, %edx            # imm = 0x702
leaq 0x5a616(%rip), %rcx     # 0x753f0
callq 0x30a0
cmpq $0x0, -0x20(%rbp)
je 0x1ade8
jmp 0x1ae07
leaq 0x59e24(%rip), %rdi     # 0x74c13
leaq 0x5959e(%rip), %rsi     # 0x74394
movl $0x703, %edx            # imm = 0x703
leaq 0x5a5ee(%rip), %rcx     # 0x753f0
callq 0x30a0
cmpq $0x0, -0x28(%rbp)
je 0x1ae10
jmp 0x1ae2f
leaq 0x5b1bc(%rip), %rdi     # 0x75fd3
leaq 0x59576(%rip), %rsi     # 0x74394
movl $0x704, %edx            # imm = 0x704
leaq 0x5a5c6(%rip), %rcx     # 0x753f0
callq 0x30a0
movq -0x28(%rbp), %rax
cmpl $0xeb0, (%rax)          # imm = 0xEB0
je 0x1ae47
movq -0x28(%rbp), %rax
cmpl $0xe13, (%rax)          # imm = 0xE13
jne 0x1ae49
jmp 0x1ae68
leaq 0x5a60e(%rip), %rdi     # 0x7545e
leaq 0x5953d(%rip), %rsi     # 0x74394
movl $0x706, %edx            # imm = 0x706
leaq 0x5a58d(%rip), %rcx     # 0x753f0
callq 0x30a0
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x1ae7d
jmp 0x1ae9c
leaq 0x5b2ef(%rip), %rdi     # 0x76173
leaq 0x59509(%rip), %rsi     # 0x74394
movl $0x709, %edx            # imm = 0x709
leaq 0x5a559(%rip), %rcx     # 0x753f0
callq 0x30a0
movq -0x28(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x113b0
leaq -0xc8(%rbp), %rdi
callq 0x113b0
leaq -0x108(%rbp), %rdi
callq 0x113b0
leaq -0x148(%rbp), %rdi
callq 0x113b0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x40(%rbp), %rcx
leaq -0x88(%rbp), %rdx
callq 0x13d10
movq -0x10(%rbp), %rdi
leaq -0x88(%rbp), %rsi
addq $0x10, %rsi
callq 0x9100
movq -0x10(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x9100
cmpq $0x0, -0x18(%rbp)
je 0x1af4e
movq -0x18(%rbp), %rdi
leaq -0x88(%rbp), %rsi
addq $0x30, %rsi
callq 0x9100
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x48(%rbp), %rcx
leaq -0xc8(%rbp), %rdx
callq 0x13d10
movq -0x10(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
addq $0x10, %rsi
callq 0x9100
movq -0x10(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x9100
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rdx
movq -0x40(%rbp), %rax
movq 0x68(%rax), %r8
leaq -0x108(%rbp), %rsi
leaq -0x88(%rbp), %rcx
callq 0x11460
movq -0x10(%rbp), %rdi
leaq -0x108(%rbp), %rsi
addq $0x10, %rsi
callq 0x9100
movq -0x10(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x9100
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rdx
movq -0x48(%rbp), %rax
movq 0x68(%rax), %r8
leaq -0x148(%rbp), %rsi
leaq -0xc8(%rbp), %rcx
callq 0x11460
movq -0x10(%rbp), %rdi
leaq -0x148(%rbp), %rsi
addq $0x10, %rsi
callq 0x9100
movq -0x10(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x9100
leaq -0x158(%rbp), %rdi
callq 0x8c90
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rax
movq 0x68(%rax), %rcx
leaq -0x158(%rbp), %rdx
callq 0x1ab00
movq -0x20(%rbp), %rax
movq %rax, -0x160(%rbp)
cmpq $0x0, -0x150(%rbp)
jne 0x1b065
leaq 0x5c859(%rip), %rax     # 0x778b5
movq %rax, -0x168(%rbp)
jmp 0x1b073
movq -0x150(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0x168(%rbp), %rax
movq %rax, -0x170(%rbp)
cmpq $0x0, -0xe0(%rbp)
jne 0x1b09b
leaq 0x5c823(%rip), %rax     # 0x778b5
movq %rax, -0x178(%rbp)
jmp 0x1b0a9
movq -0xe0(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x178(%rbp), %rax
movq %rax, -0x180(%rbp)
cmpq $0x0, -0x120(%rbp)
jne 0x1b0d1
leaq 0x5c7ed(%rip), %rax     # 0x778b5
movq %rax, -0x188(%rbp)
jmp 0x1b0df
movq -0x120(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x180(%rbp), %rcx
movq -0x170(%rbp), %rdx
movq -0x160(%rbp), %rdi
movq -0x188(%rbp), %r8
leaq 0x5a3a4(%rip), %rsi     # 0x754a6
movb $0x0, %al
callq 0x94d0
movq -0x20(%rbp), %rax
movq %rax, -0x190(%rbp)
cmpq $0x0, -0x150(%rbp)
jne 0x1b12e
leaq 0x5c790(%rip), %rax     # 0x778b5
movq %rax, -0x198(%rbp)
jmp 0x1b13c
movq -0x150(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x190(%rbp), %rdi
movq -0x198(%rbp), %rsi
callq 0x1a6c0
leaq -0x88(%rbp), %rdi
callq 0x130a0
leaq -0xc8(%rbp), %rdi
callq 0x130a0
leaq -0x108(%rbp), %rdi
callq 0x130a0
leaq -0x148(%rbp), %rdi
callq 0x130a0
leaq -0x158(%rbp), %rdi
callq 0x9310
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
nopw %cs:(%rax,%rax)