// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/backend/semantics.c
// Function: expr_shift
static void _expr_shift(
	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_SHIFT_LEFT:
		case BE_NODE_EXPR_SHIFT_RIGHT: {
			_CHECK
			ParserASTNode *node_oprd1 = node->childs[0];
			ParserASTNode *node_oprd2 = node->childs[1];
			_expr_add(ctx, node_oprd1);
			_expr_add(ctx, node_oprd2);

			const char *operator = NULL;
			if (node_type == BE_NODE_EXPR_SHIFT_LEFT) {
				operator = "<<";
			} else if (node_type == BE_NODE_EXPR_SHIFT_RIGHT) {
				operator = ">>";
			} else {
				assert(0);
			}

			_check_expr_shift_operands(
				ctx, node, node_oprd1, node_oprd2, operator, true
			);

			BE_EXPR_AST_NODE_COPY_CONSTANT2(node, node_oprd1, node_oprd2);
			if (BE_EXPR_AST_NODE_GET_CONSTANT(node)) {
				_calc_shift_constexpr(ctx, node_type, node, node_oprd1, node_oprd2);
			}
			break;
		}
		default: {
			_expr_add(ctx, node);
			break;
		}
	}

	#undef	_CHECK
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x541c9
jmp 0x541e8
leaq 0x2bf91(%rip), %rdi     # 0x80161
leaq 0x2e6a9(%rip), %rsi     # 0x82880
movl $0xc0b, %edx            # imm = 0xC0B
leaq 0x2f0ef(%rip), %rcx     # 0x832d2
callq 0x30a0
cmpq $0x0, -0x10(%rbp)
je 0x541f1
jmp 0x54210
leaq 0x22364(%rip), %rdi     # 0x7655c
leaq 0x2e681(%rip), %rsi     # 0x82880
movl $0xc0c, %edx            # imm = 0xC0C
leaq 0x2f0c7(%rip), %rcx     # 0x832d2
callq 0x30a0
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl $0xfffff170, %eax       # imm = 0xFFFFF170
subl $0x1, %eax
ja 0x5434e
jmp 0x5422c
movq -0x10(%rbp), %rax
cmpl $0x2, 0x44(%rax)
jne 0x54238
jmp 0x54257
leaq 0x2eb05(%rip), %rdi     # 0x82d44
leaq 0x2e63a(%rip), %rsi     # 0x82880
movl $0xc18, %edx            # imm = 0xC18
leaq 0x2f080(%rip), %rcx     # 0x832d2
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 0x54370
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x54370
movq $0x0, -0x30(%rbp)
cmpl $0xe90, -0x14(%rbp)     # imm = 0xE90
jne 0x542ae
leaq 0x2aab2(%rip), %rax     # 0x7ed5a
movq %rax, -0x30(%rbp)
jmp 0x542e5
cmpl $0xe91, -0x14(%rbp)     # imm = 0xE91
jne 0x542c4
leaq 0x2aadb(%rip), %rax     # 0x7ed99
movq %rax, -0x30(%rbp)
jmp 0x542e3
leaq 0x1f18f(%rip), %rdi     # 0x7345a
leaq 0x2e5ae(%rip), %rsi     # 0x82880
movl $0xc24, %edx            # imm = 0xC24
leaq 0x2eff4(%rip), %rcx     # 0x832d2
callq 0x30a0
jmp 0x542e5
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movl $0x1, %r9d
callq 0x545c0
movq -0x20(%rbp), %rcx
xorl %eax, %eax
testb $0x1, 0x70(%rcx)
movb %al, -0x31(%rbp)
je 0x5431d
movq -0x28(%rbp), %rax
movb 0x70(%rax), %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %cl
movq -0x10(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x70(%rax)
movq -0x10(%rbp), %rax
testb $0x1, 0x70(%rax)
je 0x5434c
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x10(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
callq 0x54740
jmp 0x5435b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x54370
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)