// File: /workspace/github_c_makefile_star2_O3/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 0x1ddda
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x26fb9(%rip), %rcx     # 0x44918
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x2, 0x44(%r12)
jne 0x1de5a
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 0x19b1c
leaq -0x138(%rbp), %rdi
callq 0x19b1c
leaq -0x1b8(%rbp), %rdi
callq 0x19b1c
movq %r15, %rdi
movq %r14, %rsi
leaq -0xa8(%rbp), %rdx
movq %r13, %rcx
callq 0x1a9a8
leaq -0x98(%rbp), %rsi
movq %r14, %rdi
callq 0x769e
movq %r15, %rdi
movq %r14, %rsi
leaq -0x138(%rbp), %r13
movq %r13, %rdx
movq %r12, %rcx
callq 0x1a9a8
leaq -0x128(%rbp), %rsi
movq %r14, %rdi
callq 0x769e
movq %r14, %rdi
movq %r13, %rsi
callq 0x769e
movq %r15, %rdi
leaq -0x1b8(%rbp), %r12
movq %r12, %rsi
movq -0xb0(%rbp), %rdx
movq %r13, %rcx
movq -0xb8(%rbp), %r8
callq 0x19bc3
leaq -0x1a8(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x769e
movq %r14, %rdi
movq %r12, %rsi
callq 0x769e
movq 0x18(%r15), %rdx
testq %rdx, %rdx
leaq 0x254a7(%rip), %r14     # 0x42f06
cmoveq %r14, %rdx
leaq -0x98(%rbp), %rax
movq 0x48(%rax), %rcx
testq %rcx, %rcx
cmoveq %r14, %rcx
leaq 0x28536(%rip), %rsi     # 0x45fb2
movq %rbx, %rdi
xorl %eax, %eax
callq 0x7945
movq 0x28(%r15), %rsi
testq %rsi, %rsi
cmoveq %r14, %rsi
movq 0x38(%r15), %rdx
testq %rdx, %rdx
cmoveq %r14, %rdx
movq %rbx, %rdi
callq 0x1def5
leaq -0xa8(%rbp), %rdi
callq 0x1a3fd
leaq -0x138(%rbp), %rdi
callq 0x1a3fd
jmp 0x1ddbe
cmpl $0x2, 0x44(%r12)
jne 0x1ddde
leaq -0x138(%rbp), %r13
movq %r13, %rdi
callq 0x7354
leaq -0xa8(%rbp), %rdi
callq 0x19b1c
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0xa8(%rbp), %r13
movq %r13, %rcx
movq %r12, %r8
callq 0x1e3b7
jmp 0x1dd43
cmpl $0x2, 0x44(%r12)
jne 0x1ddfd
leaq -0x138(%rbp), %r13
movq %r13, %rdi
callq 0x7354
leaq -0xa8(%rbp), %rdi
callq 0x19b1c
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0xa8(%rbp), %r13
movq %r13, %rcx
movq %r12, %r8
callq 0x1f554
jmp 0x1dd43
cmpl $0x2, 0x44(%r12)
jne 0x1de1c
leaq -0x138(%rbp), %r13
movq %r13, %rdi
callq 0x7354
leaq -0xa8(%rbp), %rdi
callq 0x19b1c
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0xa8(%rbp), %r13
movq %r13, %rcx
movq %r12, %r8
callq 0x1ef93
jmp 0x1dd43
cmpl $0x2, 0x44(%r12)
jne 0x1de3b
leaq -0x138(%rbp), %r13
movq %r13, %rdi
callq 0x7354
leaq -0xa8(%rbp), %rdi
callq 0x19b1c
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0xa8(%rbp), %r13
movq %r13, %rcx
movq %r12, %r8
callq 0x1e098
jmp 0x1dd43
cmpl $0x2, 0x44(%r12)
je 0x1dd0d
leaq 0x2d105(%rip), %rdi     # 0x4acf5
leaq 0x26d4d(%rip), %rsi     # 0x44944
leaq 0x2834f(%rip), %rcx     # 0x45f4d
movl $0x123b, %edx           # imm = 0x123B
callq 0x30a0
cmpl $0x2, 0x44(%r12)
jne 0x1de79
leaq -0x138(%rbp), %r13
movq %r13, %rdi
callq 0x7354
leaq -0xa8(%rbp), %rdi
callq 0x19b1c
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0xa8(%rbp), %r13
movq %r13, %rcx
movq %r12, %r8
callq 0x1e9e1
jmp 0x1dd43
cmpl $0x2, 0x44(%r12)
jne 0x1de98
leaq -0x138(%rbp), %r13
movq %r13, %rdi
callq 0x7354
leaq -0xa8(%rbp), %rdi
callq 0x19b1c
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0xa8(%rbp), %r13
movq %r13, %rcx
movq %r12, %r8
callq 0x1e6d6
jmp 0x1dd43
cmpl $0x2, 0x44(%r12)
je 0x1dd0d
leaq 0x2d050(%rip), %rdi     # 0x4acf5
leaq 0x26c98(%rip), %rsi     # 0x44944
leaq 0x2829a(%rip), %rcx     # 0x45f4d
movl $0x1235, %edx           # imm = 0x1235
callq 0x30a0
cmpl $0x2, 0x44(%r12)
jne 0x1deb7
leaq -0x138(%rbp), %r13
movq %r13, %rdi
callq 0x7354
leaq -0xa8(%rbp), %rdi
callq 0x19b1c
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0xa8(%rbp), %r13
movq %r13, %rcx
movq %r12, %r8
callq 0x1f7b3
jmp 0x1dd43
cmpl $0x2, 0x44(%r12)
jne 0x1ded6
leaq -0x138(%rbp), %r13
movq %r13, %rdi
callq 0x7354
leaq -0xa8(%rbp), %rdi
callq 0x19b1c
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0xa8(%rbp), %r13
movq %r13, %rcx
movq %r12, %r8
callq 0x1fa68
leaq -0x98(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x769e
movq %r14, %rdi
movq %r13, %rsi
movq %r13, %r12
callq 0x769e
movq 0x18(%r15), %rdx
testq %rdx, %rdx
leaq 0x25195(%rip), %r14     # 0x42f06
cmoveq %r14, %rdx
leaq -0x138(%rbp), %r13
movq 0x8(%r13), %rcx
testq %rcx, %rcx
cmoveq %r14, %rcx
leaq 0x28224(%rip), %rsi     # 0x45fb2
movq %rbx, %rdi
xorl %eax, %eax
callq 0x7945
movq 0x28(%r15), %rsi
testq %rsi, %rsi
cmoveq %r14, %rsi
movq 0x38(%r15), %rdx
testq %rdx, %rdx
cmoveq %r14, %rdx
movq %rbx, %rdi
callq 0x1def5
movq %r13, %rdi
callq 0x7852
movq %r12, %rdi
callq 0x1a3fd
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 0x1ddc8
leaq 0x2cf10(%rip), %rdi     # 0x4acf5
leaq 0x26b58(%rip), %rsi     # 0x44944
leaq 0x2815a(%rip), %rcx     # 0x45f4d
movl $0x1229, %edx           # imm = 0x1229
callq 0x30a0
leaq 0x2cef1(%rip), %rdi     # 0x4acf5
leaq 0x26b39(%rip), %rsi     # 0x44944
leaq 0x2813b(%rip), %rcx     # 0x45f4d
movl $0x1247, %edx           # imm = 0x1247
callq 0x30a0
leaq 0x2ced2(%rip), %rdi     # 0x4acf5
leaq 0x26b1a(%rip), %rsi     # 0x44944
leaq 0x2811c(%rip), %rcx     # 0x45f4d
movl $0x121d, %edx           # imm = 0x121D
callq 0x30a0
leaq 0x2ceb3(%rip), %rdi     # 0x4acf5
leaq 0x26afb(%rip), %rsi     # 0x44944
leaq 0x280fd(%rip), %rcx     # 0x45f4d
movl $0x1223, %edx           # imm = 0x1223
callq 0x30a0
leaq 0x2ce94(%rip), %rdi     # 0x4acf5
leaq 0x26adc(%rip), %rsi     # 0x44944
leaq 0x280de(%rip), %rcx     # 0x45f4d
movl $0x11e2, %edx           # imm = 0x11E2
callq 0x30a0
leaq 0x2ce75(%rip), %rdi     # 0x4acf5
leaq 0x26abd(%rip), %rsi     # 0x44944
leaq 0x280bf(%rip), %rcx     # 0x45f4d
movl $0x1217, %edx           # imm = 0x1217
callq 0x30a0
leaq 0x2ce56(%rip), %rdi     # 0x4acf5
leaq 0x26a9e(%rip), %rsi     # 0x44944
leaq 0x280a0(%rip), %rcx     # 0x45f4d
movl $0x122f, %edx           # imm = 0x122F
callq 0x30a0
leaq 0x2ce37(%rip), %rdi     # 0x4acf5
leaq 0x26a7f(%rip), %rsi     # 0x44944
leaq 0x28081(%rip), %rcx     # 0x45f4d
movl $0x124d, %edx           # imm = 0x124D
callq 0x30a0
leaq 0x2ce18(%rip), %rdi     # 0x4acf5
leaq 0x26a60(%rip), %rsi     # 0x44944
leaq 0x28062(%rip), %rcx     # 0x45f4d
movl $0x1241, %edx           # imm = 0x1241
callq 0x30a0