// File: /workspace/github_c_makefile_star2_O3/Ihsoh[P]ilang/compiler/frontend/semantics.c
// Function: expr_lt
static void _expr_lt(
	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_LT:
		case FE_NODE_EXPR_LE:
		case FE_NODE_EXPR_GT:
		case FE_NODE_EXPR_GE: {
			_CHECK
			ParserASTNode *node_oprd1 = node->childs[0];
			ParserASTNode *node_oprd2 = node->childs[1];
			_expr_shift(ctx, node_oprd1);
			_expr_shift(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)) {
				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 '<=' and '>' and '>=' do not support this operand combination.");
			}

			break;
		}
		case FE_NODE_EXPR_INSTANCEOF: {
			assert(node->nchilds == 2);

			ParserASTNode *node_expr = node->childs[0];
			ParserASTNode *node_type = node->childs[1];

			_expr(ctx, node_expr);
			_type(ctx, node_type, NULL);

			ParserASTNode *node_expr_type = FE_EXPR_AST_NODE_GET_TYPE_NODE(node_expr);

			bool same = fe_sem_is_compatible_type(ctx, node_expr_type, node_type, true);

			FE_EXPR_AST_NODE_SET_CONSTANT(node, true);

			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 (same) {
					FE_EXPR_AST_NODE_SET_CONSTEXPR_RESULT_INT32_VAL(node, 1);
				} else {
					FE_EXPR_AST_NODE_SET_CONSTEXPR_RESULT_INT32_VAL(node, 0);
				}
			} 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 (same) {
					FE_EXPR_AST_NODE_SET_CONSTEXPR_RESULT_INT64_VAL(node, 1);
				} else {
					FE_EXPR_AST_NODE_SET_CONSTEXPR_RESULT_INT64_VAL(node, 0);
				}
			} else {
				assert(0);
			}

			break;
		}
		default: {
			_expr_shift(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 0x2f05c
movq %rsi, %rbx
movq %rdi, %r14
movl (%rsi), %r15d
leal -0xe80(%r15), %eax
cmpl $0x4, %eax
jae 0x2eeb4
cmpl $0x2, 0x44(%rbx)
jne 0x2f07b
movq 0x48(%rbx), %rax
movq (%rax), %r13
movq 0x8(%rax), %r12
movq %r14, %rdi
movq %r13, %rsi
callq 0x2f0f7
movq %r14, %rdi
movq %r12, %rsi
callq 0x2f0f7
cmpb $0x1, 0x70(%r13)
jne 0x2ef42
movb 0x70(%r12), %al
jmp 0x2ef44
cmpl $0xe84, %r15d           # imm = 0xE84
jne 0x2efbf
cmpl $0x2, 0x44(%rbx)
jne 0x2f09a
movq 0x48(%rbx), %rax
movq (%rax), %r15
movq 0x8(%rax), %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x2b6a7
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x2b24f
movq 0x68(%r15), %rsi
movq %r14, %rdi
movq %r12, %rdx
movl $0x1, %ecx
callq 0x2a4b9
movb $0x1, 0x70(%rbx)
movl 0x30(%r14), %ecx
cmpl $0x2, %ecx
je 0x2efdb
cmpl $0x1, %ecx
jne 0x2f0b9
movb $0x4, 0x60(%rbx)
leaq 0x296e1(%rip), %rcx     # 0x58608
movq %rcx, 0x68(%rbx)
testb %al, %al
je 0x2f049
movl $0x1, 0x88(%rbx)
jmp 0x2f053
xorl %eax, %eax
movb %al, 0x70(%rbx)
movq %r13, %rdi
callq 0x2d742
testb %al, %al
je 0x2ef85
movq %r12, %rdi
callq 0x2d742
testb %al, %al
je 0x2ef85
movl 0x30(%r14), %eax
cmpl $0x2, %eax
je 0x2effb
cmpl $0x1, %eax
jne 0x2f0d8
movb $0x4, 0x60(%rbx)
leaq 0x29688(%rip), %rax     # 0x58608
jmp 0x2f006
leaq 0x1c2cf(%rip), %rsi     # 0x4b25b
leaq -0x430(%rbp), %r15
movl $0x57, %edx
movq %r15, %rdi
callq 0x3110
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq *0x58(%r14)
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movq %rbx, %rsi
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2f0f7
movb $0x5, 0x60(%rbx)
leaq 0x29682(%rip), %rcx     # 0x58668
movq %rcx, 0x68(%rbx)
testb %al, %al
je 0x2f035
movq $0x1, 0x88(%rbx)
jmp 0x2f040
movb $0x5, 0x60(%rbx)
leaq 0x29662(%rip), %rax     # 0x58668
movq %rax, 0x68(%rbx)
cmpb $0x1, 0x70(%rbx)
jne 0x2efad
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
movq $0x0, 0x88(%rbx)
movb $0x5, 0x71(%rbx)
jmp 0x2efad
movl $0x0, 0x88(%rbx)
movb $0x4, 0x71(%rbx)
jmp 0x2efad
leaq 0x13d7f(%rip), %rdi     # 0x42de2
leaq 0x1b890(%rip), %rsi     # 0x4a8fa
leaq 0x1c1ba(%rip), %rcx     # 0x4b22b
movl $0x1099, %edx           # imm = 0x1099
callq 0x30a0
leaq 0x1bc73(%rip), %rdi     # 0x4acf5
leaq 0x1b871(%rip), %rsi     # 0x4a8fa
leaq 0x1c19b(%rip), %rcx     # 0x4b22b
movl $0x10a7, %edx           # imm = 0x10A7
callq 0x30a0
leaq 0x1bc54(%rip), %rdi     # 0x4acf5
leaq 0x1b852(%rip), %rsi     # 0x4a8fa
leaq 0x1c17c(%rip), %rcx     # 0x4b22b
movl $0x10c8, %edx           # imm = 0x10C8
callq 0x30a0
leaq 0x102a0(%rip), %rdi     # 0x3f360
leaq 0x1b833(%rip), %rsi     # 0x4a8fa
leaq 0x1c15d(%rip), %rcx     # 0x4b22b
movl $0x10e9, %edx           # imm = 0x10E9
callq 0x30a0
leaq 0x10281(%rip), %rdi     # 0x3f360
leaq 0x1b814(%rip), %rsi     # 0x4a8fa
leaq 0x1c13e(%rip), %rcx     # 0x4b22b
movl $0x10bf, %edx           # imm = 0x10BF
callq 0x30a0