// File: /workspace/github_c_makefile_star2_O3/Ihsoh[P]ilang/compiler/frontend/semantics.c
// Function: expr_eq
static void _expr_eq(
	ParserContext *ctx,
	ParserASTNode *node
) {
	assert(ctx);
	assert(node);

	#define	_CHECK	\
	{	\
		assert(node->nchilds == 2);	\
	}

	uint32_t node_type = node->type;

	switch (node_type) {
		case FE_NODE_EXPR_EQ:
		case FE_NODE_EXPR_NEQ: {
			_CHECK
			ParserASTNode *node_oprd1 = node->childs[0];
			ParserASTNode *node_oprd2 = node->childs[1];
			_expr_lt(ctx, node_oprd1);
			_expr_lt(ctx, node_oprd2);

			FE_EXPR_AST_NODE_COPY_CONSTANT2(node, node_oprd1, node_oprd2);

			if ((_is_primitive_type_node(ctx, node_oprd1) && _is_primitive_type_node(ctx, node_oprd2))
					|| (_is_pointer_type_node(ctx, node_oprd1) && _is_pointer_type_node(ctx, node_oprd2))) {
				if (ctx->arch == FE_ARCH_32) {
					FE_EXPR_AST_NODE_SET_TYPE(node, FE_TYPE_INT32);
					FE_EXPR_AST_NODE_SET_TYPE_NODE(node, _NODE_TYPE_INT32);

					if (FE_EXPR_AST_NODE_GET_CONSTANT(node)) {
						_calc_binary_constexpr(ctx, node_type, node, node_oprd1, node_oprd2);
					}
				} else if (ctx->arch == FE_ARCH_64) {
					FE_EXPR_AST_NODE_SET_TYPE(node, FE_TYPE_INT64);
					FE_EXPR_AST_NODE_SET_TYPE_NODE(node, _NODE_TYPE_INT64);

					if (FE_EXPR_AST_NODE_GET_CONSTANT(node)) {
						_calc_binary_constexpr(ctx, node_type, node, node_oprd1, node_oprd2);
					}
				} else {
					assert(0);
				}
			} else {
				_SYNERR_NODE(ctx, node, "binary operator '==' and '!=' do not support this operand combination.");
			}

			break;
		}
		default: {
			_expr_lt(ctx, node);
			break;
		}
	}

	#undef	_CHECK
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
testq %rsi, %rsi
je 0x2edc6
movq %rsi, %rbx
movq %rdi, %r14
movl (%rsi), %r15d
movl %r15d, %eax
andl $-0x2, %eax
cmpl $0xe70, %eax            # imm = 0xE70
jne 0x2ecd2
cmpl $0x2, 0x44(%rbx)
jne 0x2ede5
movq 0x48(%rbx), %rax
movq (%rax), %r13
movq 0x8(%rax), %r12
movq %r14, %rdi
movq %r13, %rsi
callq 0x2ee42
movq %r14, %rdi
movq %r12, %rsi
callq 0x2ee42
cmpb $0x1, 0x70(%r13)
jne 0x2ecee
movb 0x70(%r12), %al
jmp 0x2ecf0
movq %r14, %rdi
movq %rbx, %rsi
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2ee42
xorl %eax, %eax
movb %al, 0x70(%rbx)
movq %r13, %rdi
callq 0x2d742
testb %al, %al
je 0x2ed0b
movq %r12, %rdi
callq 0x2d742
testb %al, %al
jne 0x2ed31
movzbl 0x1(%r13), %eax
shll $0x8, %eax
cmpl $0xe00, %eax            # imm = 0xE00
jne 0x2ee04
cmpb $0x10, 0x60(%r13)
jne 0x2ed50
movq %r12, %rdi
callq 0x2d6e4
testb %al, %al
je 0x2ed50
movl 0x30(%r14), %eax
cmpl $0x2, %eax
je 0x2ed7a
cmpl $0x1, %eax
jne 0x2ee23
movb $0x4, 0x60(%rbx)
leaq 0x298ba(%rip), %rax     # 0x58608
jmp 0x2ed85
leaq 0x1c48d(%rip), %rsi     # 0x4b1e4
leaq -0x430(%rbp), %r15
movl $0x47, %edx
movq %r15, %rdi
callq 0x3110
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq *0x58(%r14)
jmp 0x2edb4
movb $0x5, 0x60(%rbx)
leaq 0x298e3(%rip), %rax     # 0x58668
movq %rax, 0x68(%rbx)
cmpb $0x1, 0x70(%rbx)
jne 0x2edb4
movq %r14, %rdi
movl %r15d, %esi
movq %rbx, %rdx
movq %r13, %rcx
movq %r12, %r8
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2d93b
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x14015(%rip), %rdi     # 0x42de2
leaq 0x1bb26(%rip), %rsi     # 0x4a8fa
leaq 0x1c3d9(%rip), %rcx     # 0x4b1b4
movl $0x10fc, %edx           # imm = 0x10FC
callq 0x30a0
leaq 0x1bf09(%rip), %rdi     # 0x4acf5
leaq 0x1bb07(%rip), %rsi     # 0x4a8fa
leaq 0x1c3ba(%rip), %rcx     # 0x4b1b4
movl $0x1108, %edx           # imm = 0x1108
callq 0x30a0
leaq 0x1cc8c(%rip), %rdi     # 0x4ba97
leaq 0x1bae8(%rip), %rsi     # 0x4a8fa
leaq 0x1d265(%rip), %rcx     # 0x4c07e
movl $0x1ff, %edx            # imm = 0x1FF
callq 0x30a0
leaq 0x10536(%rip), %rdi     # 0x3f360
leaq 0x1bac9(%rip), %rsi     # 0x4a8fa
leaq 0x1c37c(%rip), %rcx     # 0x4b1b4
movl $0x1121, %edx           # imm = 0x1121
callq 0x30a0