// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/backend/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 BE_NODE_EXPR_EQ:
		case BE_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);

			BE_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 == BE_ARCH_32) {
					BE_EXPR_AST_NODE_SET_TYPE(node, BE_TYPE_INT32);
					BE_EXPR_AST_NODE_SET_TYPE_NODE(node, _NODE_TYPE_INT32);

					if (BE_EXPR_AST_NODE_GET_CONSTANT(node)) {
						_calc_binary_constexpr(ctx, node_type, node, node_oprd1, node_oprd2);
					}
				} else if (ctx->arch == BE_ARCH_64) {
					BE_EXPR_AST_NODE_SET_TYPE(node, BE_TYPE_INT64);
					BE_EXPR_AST_NODE_SET_TYPE_NODE(node, _NODE_TYPE_INT64);

					if (BE_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
subq $0x440, %rsp            # imm = 0x440
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x53b6c
jmp 0x53b8b
leaq 0x2c5ee(%rip), %rdi     # 0x80161
leaq 0x2ed06(%rip), %rsi     # 0x82880
movl $0xc7a, %edx            # imm = 0xC7A
leaq 0x2f64e(%rip), %rcx     # 0x831d4
callq 0x30a0
cmpq $0x0, -0x10(%rbp)
je 0x53b94
jmp 0x53bb3
leaq 0x229c1(%rip), %rdi     # 0x7655c
leaq 0x2ecde(%rip), %rsi     # 0x82880
movl $0xc7b, %edx            # imm = 0xC7B
leaq 0x2f626(%rip), %rcx     # 0x831d4
callq 0x30a0
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl $0xfffff190, %eax       # imm = 0xFFFFF190
subl $0x1, %eax
ja 0x53d8f
jmp 0x53bcf
movq -0x10(%rbp), %rax
cmpl $0x2, 0x44(%rax)
jne 0x53bdb
jmp 0x53bfa
leaq 0x2f162(%rip), %rdi     # 0x82d44
leaq 0x2ec97(%rip), %rsi     # 0x82880
movl $0xc87, %edx            # imm = 0xC87
leaq 0x2f5df(%rip), %rcx     # 0x831d4
callq 0x30a0
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x53f70
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x53f70
movq -0x20(%rbp), %rcx
xorl %eax, %eax
testb $0x1, 0x70(%rcx)
movb %al, -0x431(%rbp)
je 0x53c52
movq -0x28(%rbp), %rax
movb 0x70(%rax), %al
movb %al, -0x431(%rbp)
movb -0x431(%rbp), %cl
movq -0x10(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x70(%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x50be0
testb $0x1, %al
jne 0x53c75
jmp 0x53c86
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x50be0
testb $0x1, %al
jne 0x53cb2
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x50b30
testb $0x1, %al
jne 0x53c9c
jmp 0x53d5f
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x50b30
testb $0x1, %al
jne 0x53cb2
jmp 0x53d5f
movq -0x8(%rbp), %rax
cmpl $0x1, 0x30(%rax)
jne 0x53cf7
movq -0x10(%rbp), %rax
movb $0x4, 0x60(%rax)
movq -0x10(%rbp), %rax
leaq 0x40ca1(%rip), %rcx     # 0x94970
movq %rcx, 0x68(%rax)
movq -0x10(%rbp), %rax
testb $0x1, 0x70(%rax)
je 0x53cf5
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x10(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
callq 0x513e0
jmp 0x53d5d
movq -0x8(%rbp), %rax
cmpl $0x2, 0x30(%rax)
jne 0x53d3c
movq -0x10(%rbp), %rax
movb $0x5, 0x60(%rax)
movq -0x10(%rbp), %rax
leaq 0x40cbc(%rip), %rcx     # 0x949d0
movq %rcx, 0x68(%rax)
movq -0x10(%rbp), %rax
testb $0x1, 0x70(%rax)
je 0x53d3a
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x10(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
callq 0x513e0
jmp 0x53d5b
leaq 0x1f717(%rip), %rdi     # 0x7345a
leaq 0x2eb36(%rip), %rsi     # 0x82880
movl $0xca0, %edx            # imm = 0xCA0
leaq 0x2f47e(%rip), %rcx     # 0x831d4
callq 0x30a0
jmp 0x53d5d
jmp 0x53d8d
leaq -0x430(%rbp), %rdi
leaq 0x2f497(%rip), %rsi     # 0x83204
movb $0x0, %al
callq 0x3160
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x430(%rbp), %rdx
callq *%rax
jmp 0x53d9c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x53f70
addq $0x440, %rsp            # imm = 0x440
popq %rbp
retq
nopw %cs:(%rax,%rax)