// File: /workspace/github_c_makefile_star2_O2/Ihsoh[P]ilang/compiler/frontend/irgen_llvmir.c
// Function: ir_expr_assign
static bool _ir_expr_assign(
	IRGeneratorLlvmirContext *ctx,
	ResizableString *rstr,
	_ExprResult *expr_result,
	ParserASTNode *node
) {
	assert(ctx);
	assert(rstr);
	assert(expr_result);
	assert(node);

	#define	_A(func)	\
		assert(node->nchilds == 2);	\
			\
		ResizableString rstr_result_lhs_ptr;	\
		rstr_init(&rstr_result_lhs_ptr);	\
			\
		_ExprResult result;	\
		_expr_result_init(&result);	\
			\
		(func)(ctx, rstr, &rstr_result_lhs_ptr, &result, node);	\
		rstr_append_with_rstr(rstr, &(result.rstr_for_result_ptr));	\
		rstr_append_with_rstr(rstr, &(result.rstr_for_result));	\
			\
		rstr_appendf(	\
			&(expr_result->rstr_for_result),	\
			"store %s, %s\n",	\
			RSTR_CSTR(&(result.rstr_result)),	\
			RSTR_CSTR(&rstr_result_lhs_ptr)	\
		);	\
		_expr_result_set_result(	\
			expr_result,	\
			RSTR_CSTR(&(result.rstr_result_type)),	\
			RSTR_CSTR(&(result.rstr_result_val))	\
		);	\
			\
		rstr_free(&rstr_result_lhs_ptr);	\
			\
		_expr_result_free(&result);

	switch (node->type) {
		case FE_NODE_EXPR_ASSIGN: {
			assert(node->nchilds == 2);

			ParserASTNode *node_lhs = node->childs[0];
			ParserASTNode *node_rhs = node->childs[1];

			ParserASTNode *node_lhs_type = FE_EXPR_AST_NODE_GET_TYPE_NODE(node_lhs);
			ParserASTNode *ndoe_rhs_type = FE_EXPR_AST_NODE_GET_TYPE_NODE(node_rhs);

			_ExprResult result_lhs;
			_ExprResult result_rhs;
			_ExprResult result_rhs_casted;

			_expr_result_init(&result_lhs);
			_expr_result_init(&result_rhs);
			_expr_result_init(&result_rhs_casted);

			_ir_expr(ctx, rstr, &result_lhs, node_lhs);
			rstr_append_with_rstr(rstr, &(result_lhs.rstr_for_result_ptr));

			_ir_expr(ctx, rstr, &result_rhs, node_rhs);
			rstr_append_with_rstr(rstr, &(result_rhs.rstr_for_result_ptr));
			rstr_append_with_rstr(rstr, &(result_rhs.rstr_for_result));

			_expr_result_cast(
				ctx,
				&result_rhs_casted,
				node_lhs_type,
				&result_rhs,
				ndoe_rhs_type
			);
			rstr_append_with_rstr(rstr, &(result_rhs_casted.rstr_for_result_ptr));
			rstr_append_with_rstr(rstr, &(result_rhs_casted.rstr_for_result));

			rstr_appendf(
				&(expr_result->rstr_for_result),
				"store %s, %s\n",
				RSTR_CSTR(&(result_rhs_casted.rstr_result)),
				RSTR_CSTR(&(result_lhs.rstr_result_ptr))
			);
			_expr_result_set_result(
				expr_result,
				RSTR_CSTR(&(result_rhs_casted.rstr_result_type)),
				RSTR_CSTR(&(result_rhs_casted.rstr_result_val))
			);

			_expr_result_free(&result_lhs);
			_expr_result_free(&result_rhs);
			_expr_result_free(&result_rhs_casted);

			return true;
		}
		case FE_NODE_EXPR_ADD_ASSIGN: {

			_A(_ir_expr_add)

			return true;
		}
		case FE_NODE_EXPR_SUB_ASSIGN: {

			_A(_ir_expr_sub)

			return true;
		}
		case FE_NODE_EXPR_MUL_ASSIGN: {

			_A(_ir_expr_mul)

			return true;
		}
		case FE_NODE_EXPR_DIV_ASSIGN: {
			
			_A(_ir_expr_div)
			
			return true;
		}
		case FE_NODE_EXPR_MOD_ASSIGN: {

			_A(_ir_expr_mod)
			
			return true;
		}
		case FE_NODE_EXPR_BAND_ASSIGN: {
			
			_A(_ir_expr_bitwise)

			return true;
		}
		case FE_NODE_EXPR_BOR_ASSIGN: {

			_A(_ir_expr_bitwise)
			
			return true;
		}
		case FE_NODE_EXPR_BXOR_ASSIGN: {

			_A(_ir_expr_bitwise)
			
			return true;
		}
		case FE_NODE_EXPR_SHIFT_LEFT_ASSIGN: {
			
			_A(_ir_expr_shift_left)

			return true;
		}
		case FE_NODE_EXPR_SHIFT_RIGHT_ASSIGN: {
			
			_A(_ir_expr_shift_right)

			return true;
		}
		default: {
			return false;
		}
	}

	#undef	_A
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movl $0xfffff1f0, %eax       # imm = 0xFFFFF1F0
addl (%rcx), %eax
cmpl $0xa, %eax
ja 0x1ca89
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x2534e(%rip), %rcx     # 0x4195c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x2, 0x44(%r12)
jne 0x1cb09
movq 0x48(%r12), %rax
movq (%rax), %r13
movq 0x8(%rax), %r12
movq 0x68(%r13), %rax
movq %rax, -0xb0(%rbp)
movq 0x68(%r12), %rax
movq %rax, -0xb8(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x188c9
leaq -0x138(%rbp), %rdi
callq 0x188c9
leaq -0x1b8(%rbp), %rdi
callq 0x188c9
movq %r15, %rdi
movq %r14, %rsi
leaq -0xa8(%rbp), %rdx
movq %r13, %rcx
callq 0x19792
leaq -0x98(%rbp), %rsi
movq %r14, %rdi
callq 0x712e
movq %r15, %rdi
movq %r14, %rsi
leaq -0x138(%rbp), %r13
movq %r13, %rdx
movq %r12, %rcx
callq 0x19792
leaq -0x128(%rbp), %rsi
movq %r14, %rdi
callq 0x712e
movq %r14, %rdi
movq %r13, %rsi
callq 0x712e
movq %r15, %rdi
leaq -0x1b8(%rbp), %r12
movq %r12, %rsi
movq -0xb0(%rbp), %rdx
movq %r13, %rcx
movq -0xb8(%rbp), %r8
callq 0x1896e
leaq -0x1a8(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x712e
movq %r14, %rdi
movq %r12, %rsi
callq 0x712e
movq 0x18(%r15), %rdx
testq %rdx, %rdx
leaq 0x23808(%rip), %r14     # 0x3ff16
cmoveq %r14, %rdx
leaq -0x98(%rbp), %rax
movq 0x48(%rax), %rcx
testq %rcx, %rcx
cmoveq %r14, %rcx
leaq 0x268cb(%rip), %rsi     # 0x42ff6
movq %rbx, %rdi
xorl %eax, %eax
callq 0x739a
movq 0x28(%r15), %rsi
testq %rsi, %rsi
cmoveq %r14, %rsi
movq 0x38(%r15), %rdx
testq %rdx, %rdx
cmoveq %r14, %rdx
movq %rbx, %rdi
callq 0x1cba4
leaq -0xa8(%rbp), %rdi
callq 0x191df
leaq -0x138(%rbp), %rdi
callq 0x191df
jmp 0x1ca6d
cmpl $0x2, 0x44(%r12)
jne 0x1ca8d
leaq -0x138(%rbp), %r13
movq %r13, %rdi
callq 0x6e1c
leaq -0xa8(%rbp), %rdi
callq 0x188c9
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0xa8(%rbp), %r13
movq %r13, %rcx
movq %r12, %r8
callq 0x1d04c
jmp 0x1c9f2
cmpl $0x2, 0x44(%r12)
jne 0x1caac
leaq -0x138(%rbp), %r13
movq %r13, %rdi
callq 0x6e1c
leaq -0xa8(%rbp), %rdi
callq 0x188c9
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0xa8(%rbp), %r13
movq %r13, %rcx
movq %r12, %r8
callq 0x1e167
jmp 0x1c9f2
cmpl $0x2, 0x44(%r12)
jne 0x1cacb
leaq -0x138(%rbp), %r13
movq %r13, %rdi
callq 0x6e1c
leaq -0xa8(%rbp), %rdi
callq 0x188c9
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0xa8(%rbp), %r13
movq %r13, %rcx
movq %r12, %r8
callq 0x1dbe1
jmp 0x1c9f2
cmpl $0x2, 0x44(%r12)
jne 0x1caea
leaq -0x138(%rbp), %r13
movq %r13, %rdi
callq 0x6e1c
leaq -0xa8(%rbp), %rdi
callq 0x188c9
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0xa8(%rbp), %r13
movq %r13, %rcx
movq %r12, %r8
callq 0x1cd3f
jmp 0x1c9f2
cmpl $0x2, 0x44(%r12)
je 0x1c9bc
leaq 0x2b496(%rip), %rdi     # 0x47d35
leaq 0x250e2(%rip), %rsi     # 0x41988
leaq 0x266e4(%rip), %rcx     # 0x42f91
movl $0x123b, %edx           # imm = 0x123B
callq 0x30a0
cmpl $0x2, 0x44(%r12)
jne 0x1cb28
leaq -0x138(%rbp), %r13
movq %r13, %rdi
callq 0x6e1c
leaq -0xa8(%rbp), %rdi
callq 0x188c9
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0xa8(%rbp), %r13
movq %r13, %rcx
movq %r12, %r8
callq 0x1d652
jmp 0x1c9f2
cmpl $0x2, 0x44(%r12)
jne 0x1cb47
leaq -0x138(%rbp), %r13
movq %r13, %rdi
callq 0x6e1c
leaq -0xa8(%rbp), %rdi
callq 0x188c9
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0xa8(%rbp), %r13
movq %r13, %rcx
movq %r12, %r8
callq 0x1d359
jmp 0x1c9f2
cmpl $0x2, 0x44(%r12)
je 0x1c9bc
leaq 0x2b3e1(%rip), %rdi     # 0x47d35
leaq 0x2502d(%rip), %rsi     # 0x41988
leaq 0x2662f(%rip), %rcx     # 0x42f91
movl $0x1235, %edx           # imm = 0x1235
callq 0x30a0
cmpl $0x2, 0x44(%r12)
jne 0x1cb66
leaq -0x138(%rbp), %r13
movq %r13, %rdi
callq 0x6e1c
leaq -0xa8(%rbp), %rdi
callq 0x188c9
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0xa8(%rbp), %r13
movq %r13, %rcx
movq %r12, %r8
callq 0x1e3b5
jmp 0x1c9f2
cmpl $0x2, 0x44(%r12)
jne 0x1cb85
leaq -0x138(%rbp), %r13
movq %r13, %rdi
callq 0x6e1c
leaq -0xa8(%rbp), %rdi
callq 0x188c9
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0xa8(%rbp), %r13
movq %r13, %rcx
movq %r12, %r8
callq 0x1e652
leaq -0x98(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x712e
movq %r14, %rdi
movq %r13, %rsi
movq %r13, %r12
callq 0x712e
movq 0x18(%r15), %rdx
testq %rdx, %rdx
leaq 0x234f6(%rip), %r14     # 0x3ff16
cmoveq %r14, %rdx
leaq -0x138(%rbp), %r13
movq 0x8(%r13), %rcx
testq %rcx, %rcx
cmoveq %r14, %rcx
leaq 0x265b9(%rip), %rsi     # 0x42ff6
movq %rbx, %rdi
xorl %eax, %eax
callq 0x739a
movq 0x28(%r15), %rsi
testq %rsi, %rsi
cmoveq %r14, %rsi
movq 0x38(%r15), %rdx
testq %rdx, %rdx
cmoveq %r14, %rdx
movq %rbx, %rdi
callq 0x1cba4
movq %r13, %rdi
callq 0x72b9
movq %r12, %rdi
callq 0x191df
movb $0x1, %al
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x1ca77
leaq 0x2b2a1(%rip), %rdi     # 0x47d35
leaq 0x24eed(%rip), %rsi     # 0x41988
leaq 0x264ef(%rip), %rcx     # 0x42f91
movl $0x1229, %edx           # imm = 0x1229
callq 0x30a0
leaq 0x2b282(%rip), %rdi     # 0x47d35
leaq 0x24ece(%rip), %rsi     # 0x41988
leaq 0x264d0(%rip), %rcx     # 0x42f91
movl $0x1247, %edx           # imm = 0x1247
callq 0x30a0
leaq 0x2b263(%rip), %rdi     # 0x47d35
leaq 0x24eaf(%rip), %rsi     # 0x41988
leaq 0x264b1(%rip), %rcx     # 0x42f91
movl $0x121d, %edx           # imm = 0x121D
callq 0x30a0
leaq 0x2b244(%rip), %rdi     # 0x47d35
leaq 0x24e90(%rip), %rsi     # 0x41988
leaq 0x26492(%rip), %rcx     # 0x42f91
movl $0x1223, %edx           # imm = 0x1223
callq 0x30a0
leaq 0x2b225(%rip), %rdi     # 0x47d35
leaq 0x24e71(%rip), %rsi     # 0x41988
leaq 0x26473(%rip), %rcx     # 0x42f91
movl $0x11e2, %edx           # imm = 0x11E2
callq 0x30a0
leaq 0x2b206(%rip), %rdi     # 0x47d35
leaq 0x24e52(%rip), %rsi     # 0x41988
leaq 0x26454(%rip), %rcx     # 0x42f91
movl $0x1217, %edx           # imm = 0x1217
callq 0x30a0
leaq 0x2b1e7(%rip), %rdi     # 0x47d35
leaq 0x24e33(%rip), %rsi     # 0x41988
leaq 0x26435(%rip), %rcx     # 0x42f91
movl $0x122f, %edx           # imm = 0x122F
callq 0x30a0
leaq 0x2b1c8(%rip), %rdi     # 0x47d35
leaq 0x24e14(%rip), %rsi     # 0x41988
leaq 0x26416(%rip), %rcx     # 0x42f91
movl $0x124d, %edx           # imm = 0x124D
callq 0x30a0
leaq 0x2b1a9(%rip), %rdi     # 0x47d35
leaq 0x24df5(%rip), %rsi     # 0x41988
leaq 0x263f7(%rip), %rcx     # 0x42f91
movl $0x1241, %edx           # imm = 0x1241
callq 0x30a0