// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/frontend/semantics.c
// Function: check_expr_add_operands
static void _check_expr_add_operands(
	ParserContext *ctx,
	ParserASTNode *node,
	ParserASTNode *node_oprd1,
	ParserASTNode *node_oprd2,
	const char *operator,
	bool set_type
) {
	assert(ctx);
	assert(node);
	assert(node_oprd1);
	assert(node_oprd2);
	assert(operator);

	if (_is_pointer_type_node(ctx, node_oprd1) && _is_integer_type_node(ctx, node_oprd2)) {
		if (set_type) {
			FE_EXPR_AST_NODE_COPY(node, node_oprd1);
		}
	} else if (_is_number_type_node(ctx, node_oprd1) && _is_number_type_node(ctx, node_oprd2)) {
		if (set_type) {
			int32_t weight_oprd1_type = _get_primitive_type_weight_by_expr_node(ctx, node_oprd1);
			int32_t weight_oprd2_type = _get_primitive_type_weight_by_expr_node(ctx, node_oprd2);
			if (weight_oprd1_type > weight_oprd2_type) {
				FE_EXPR_AST_NODE_COPY(node, node_oprd1);
			} else {
				FE_EXPR_AST_NODE_COPY(node, node_oprd2);
			}
		}
	} else {
		_SYNERR_NODE(
			ctx,
			node,
			"binary operator '%s' do not support this operand combination.",
			operator
		);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x440, %rsp            # imm = 0x440
movb %r9b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
andb $0x1, %al
movb %al, -0x29(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x51660
jmp 0x5167f
leaq 0x2aeef(%rip), %rdi     # 0x7c556
leaq 0x2cbdc(%rip), %rsi     # 0x7e24a
movl $0xfc7, %edx            # imm = 0xFC7
leaq 0x2e619(%rip), %rcx     # 0x7fc93
callq 0x30a0
cmpq $0x0, -0x10(%rbp)
je 0x51688
jmp 0x516a7
leaq 0x24944(%rip), %rdi     # 0x75fd3
leaq 0x2cbb4(%rip), %rsi     # 0x7e24a
movl $0xfc8, %edx            # imm = 0xFC8
leaq 0x2e5f1(%rip), %rcx     # 0x7fc93
callq 0x30a0
cmpq $0x0, -0x18(%rbp)
je 0x516b0
jmp 0x516cf
leaq 0x2e57f(%rip), %rdi     # 0x7fc36
leaq 0x2cb8c(%rip), %rsi     # 0x7e24a
movl $0xfc9, %edx            # imm = 0xFC9
leaq 0x2e5c9(%rip), %rcx     # 0x7fc93
callq 0x30a0
cmpq $0x0, -0x20(%rbp)
je 0x516d8
jmp 0x516f7
leaq 0x2e562(%rip), %rdi     # 0x7fc41
leaq 0x2cb64(%rip), %rsi     # 0x7e24a
movl $0xfca, %edx            # imm = 0xFCA
leaq 0x2e5a1(%rip), %rcx     # 0x7fc93
callq 0x30a0
cmpq $0x0, -0x28(%rbp)
je 0x51700
jmp 0x5171f
leaq 0x2e545(%rip), %rdi     # 0x7fc4c
leaq 0x2cb3c(%rip), %rsi     # 0x7e24a
movl $0xfcb, %edx            # imm = 0xFCB
leaq 0x2e579(%rip), %rcx     # 0x7fc93
callq 0x30a0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x52770
testb $0x1, %al
jne 0x51732
jmp 0x5176a
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x526c0
testb $0x1, %al
jne 0x51745
jmp 0x5176a
testb $0x1, -0x29(%rbp)
je 0x51765
movq -0x10(%rbp), %rdi
addq $0x60, %rdi
movq -0x18(%rbp), %rsi
addq $0x60, %rsi
movl $0x30, %edx
callq 0x3110
jmp 0x5182c
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x57d20
testb $0x1, %al
jne 0x5177d
jmp 0x517f8
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x57d20
testb $0x1, %al
jne 0x51790
jmp 0x517f8
testb $0x1, -0x29(%rbp)
je 0x517f6
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x528d0
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x528d0
movl %eax, -0x34(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x34(%rbp), %eax
jle 0x517da
movq -0x10(%rbp), %rdi
addq $0x60, %rdi
movq -0x18(%rbp), %rsi
addq $0x60, %rsi
movl $0x30, %edx
callq 0x3110
jmp 0x517f4
movq -0x10(%rbp), %rdi
addq $0x60, %rdi
movq -0x20(%rbp), %rsi
addq $0x60, %rsi
movl $0x30, %edx
callq 0x3110
jmp 0x517f6
jmp 0x5182a
leaq -0x440(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x2e44b(%rip), %rsi     # 0x7fc55
movb $0x0, %al
callq 0x3160
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x440(%rbp), %rdx
callq *%rax
jmp 0x5182c
addq $0x440, %rsp            # imm = 0x440
popq %rbp
retq
nopw %cs:(%rax,%rax)