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

			_check_expr_add_operands(
				ctx, node, node_oprd1, node_oprd2, "+", true
			);

			BE_EXPR_AST_NODE_COPY_CONSTANT2(node, node_oprd1, node_oprd2);
			if (BE_EXPR_AST_NODE_GET_CONSTANT(node)) {
				_calc_binary_constexpr(ctx, node_type, node, node_oprd1, node_oprd2);
			}
			break;
		}
		case BE_NODE_EXPR_SUB: {
			_CHECK
			ParserASTNode *node_oprd1 = node->childs[0];
			ParserASTNode *node_oprd2 = node->childs[1];
			_expr_unary(ctx, node_oprd1);
			_expr_unary(ctx, node_oprd2);

			_check_expr_sub_operands(
				ctx, node, node_oprd1, node_oprd2, "-", true
			);

			BE_EXPR_AST_NODE_COPY_CONSTANT2(node, node_oprd1, node_oprd2);
			if (BE_EXPR_AST_NODE_GET_CONSTANT(node)) {
				_calc_binary_constexpr(ctx, node_type, node, node_oprd1, node_oprd2);
			}
			break;
		}
		default: {
			_expr_mul(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 0x54389
jmp 0x543a8
leaq 0x2bdd1(%rip), %rdi     # 0x80161
leaq 0x2e4e9(%rip), %rsi     # 0x82880
movl $0xbb5, %edx            # imm = 0xBB5
leaq 0x2ef62(%rip), %rcx     # 0x83305
callq 0x30a0
cmpq $0x0, -0x10(%rbp)
je 0x543b1
jmp 0x543d0
leaq 0x221a4(%rip), %rdi     # 0x7655c
leaq 0x2e4c1(%rip), %rsi     # 0x82880
movl $0xbb6, %edx            # imm = 0xBB6
leaq 0x2ef3a(%rip), %rcx     # 0x83305
callq 0x30a0
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x3c(%rbp)
subl $0xea0, %eax            # imm = 0xEA0
je 0x543fb
jmp 0x543e8
movl -0x3c(%rbp), %eax
subl $0xea1, %eax            # imm = 0xEA1
je 0x544ce
jmp 0x5459e
movq -0x10(%rbp), %rax
cmpl $0x2, 0x44(%rax)
jne 0x54407
jmp 0x54426
leaq 0x2e936(%rip), %rdi     # 0x82d44
leaq 0x2e46b(%rip), %rsi     # 0x82880
movl $0xbc1, %edx            # imm = 0xBC1
leaq 0x2eee4(%rip), %rcx     # 0x83305
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 0x54cb0
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x54cb0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
leaq 0x20136(%rip), %r8      # 0x745ac
movl $0x1, %r9d
callq 0x555a0
movq -0x20(%rbp), %rcx
xorl %eax, %eax
testb $0x1, 0x70(%rcx)
movb %al, -0x3d(%rbp)
je 0x5449a
movq -0x28(%rbp), %rax
movb 0x70(%rax), %al
movb %al, -0x3d(%rbp)
movb -0x3d(%rbp), %cl
movq -0x10(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x70(%rax)
movq -0x10(%rbp), %rax
testb $0x1, 0x70(%rax)
je 0x544c9
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x10(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
callq 0x513e0
jmp 0x545ab
movq -0x10(%rbp), %rax
cmpl $0x2, 0x44(%rax)
jne 0x544da
jmp 0x544f9
leaq 0x2e863(%rip), %rdi     # 0x82d44
leaq 0x2e398(%rip), %rsi     # 0x82880
movl $0xbd2, %edx            # imm = 0xBD2
leaq 0x2ee11(%rip), %rcx     # 0x83305
callq 0x30a0
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x54cb0
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x54cb0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
leaq 0x2a8bb(%rip), %r8      # 0x7ee04
movl $0x1, %r9d
callq 0x557b0
movq -0x30(%rbp), %rcx
xorl %eax, %eax
testb $0x1, 0x70(%rcx)
movb %al, -0x3e(%rbp)
je 0x5456d
movq -0x38(%rbp), %rax
movb 0x70(%rax), %al
movb %al, -0x3e(%rbp)
movb -0x3e(%rbp), %cl
movq -0x10(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x70(%rax)
movq -0x10(%rbp), %rax
testb $0x1, 0x70(%rax)
je 0x5459c
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x10(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %r8
callq 0x513e0
jmp 0x545ab
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x559c0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)