// File: /workspace/github_c_makefile_star2_O2/Ihsoh[P]ilang/compiler/frontend/semantics.c
// Function: expr_or
static void _expr_or(
	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_OR: {
			_CHECK
			ParserASTNode *node_oprd1 = node->childs[0];
			ParserASTNode *node_oprd2 = node->childs[1];
			_expr_and(ctx, node_oprd1);
			_expr_and(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 '||' do not support this operand combination.");
			}

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

	#undef	_CHECK
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
testq %rsi, %rsi
je 0x2b377
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0xe20, (%rsi)          # imm = 0xE20
jne 0x2b29b
cmpl $0x2, 0x44(%rbx)
jne 0x2b396
movq 0x48(%rbx), %rax
movq (%rax), %r12
movq 0x8(%rax), %r15
movq %r14, %rdi
movq %r12, %rsi
callq 0x2b4f4
movq %r14, %rdi
movq %r15, %rsi
callq 0x2b4f4
cmpb $0x1, 0x70(%r12)
jne 0x2b2b5
movb 0x70(%r15), %al
jmp 0x2b2b7
movq %r14, %rdi
movq %rbx, %rsi
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2b4f4
xorl %eax, %eax
movb %al, 0x70(%rbx)
movq %r12, %rdi
callq 0x2b493
testb %al, %al
je 0x2b2f1
movq %r15, %rdi
callq 0x2b493
testb %al, %al
je 0x2b2f1
movl 0x30(%r14), %eax
cmpl $0x2, %eax
je 0x2b33d
cmpl $0x1, %eax
jne 0x2b3b5
movb $0x4, 0x60(%rbx)
leaq 0x2a319(%rip), %rax     # 0x55608
jmp 0x2b348
movups 0x1cde4(%rip), %xmm0    # 0x480dc
leaq -0x420(%rbp), %rdx
movups %xmm0, 0x2e(%rdx)
movups 0x1cdc4(%rip), %xmm0    # 0x480ce
movaps %xmm0, 0x20(%rdx)
movups 0x1cda9(%rip), %xmm0    # 0x480be
movaps %xmm0, 0x10(%rdx)
movups 0x1cd8e(%rip), %xmm0    # 0x480ae
movaps %xmm0, (%rdx)
movq %r14, %rdi
movq %rbx, %rsi
callq *0x58(%r14)
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movb $0x5, 0x60(%rbx)
leaq 0x2a320(%rip), %rax     # 0x55668
movq %rax, 0x68(%rbx)
cmpb $0x1, 0x70(%rbx)
jne 0x2b32d
movq %r14, %rdi
movl $0xe20, %esi            # imm = 0xE20
movq %rbx, %rdx
movq %r12, %rcx
movq %r15, %r8
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2b68c
leaq 0x14a74(%rip), %rdi     # 0x3fdf2
leaq 0x1c5b5(%rip), %rsi     # 0x4793a
leaq 0x1ccf2(%rip), %rcx     # 0x4807e
movl $0x125a, %edx           # imm = 0x125A
callq 0x30a0
leaq 0x1c998(%rip), %rdi     # 0x47d35
leaq 0x1c596(%rip), %rsi     # 0x4793a
leaq 0x1ccd3(%rip), %rcx     # 0x4807e
movl $0x1265, %edx           # imm = 0x1265
callq 0x30a0
leaq 0x10fa4(%rip), %rdi     # 0x3c360
leaq 0x1c577(%rip), %rsi     # 0x4793a
leaq 0x1ccb4(%rip), %rcx     # 0x4807e
movl $0x127d, %edx           # imm = 0x127D
callq 0x30a0