// File: /workspace/github_c_makefile_star2_O1/Ihsoh[P]ilang/compiler/frontend/irgen.c
// Function: ir_expr_assign
static bool _ir_expr_assign(
	IRGeneratorContext *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(&rstr_result_lhs_ptr),	\
			RSTR_CSTR(&(result.rstr_result))	\
		);	\
		_expr_result_set_result(	\
			expr_result,	\
			RSTR_CSTR(&(result.rstr_result))	\
		);	\
			\
		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_lhs.rstr_result_ptr)),
				RSTR_CSTR(&(result_rhs_casted.rstr_result))
			);
			_expr_result_set_result(
				expr_result,
				RSTR_CSTR(&(result_rhs_casted.rstr_result))
			);

			_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 $0xd8, %rsp
movl $0xfffff1f0, %eax       # imm = 0xFFFFF1F0
addl (%rcx), %eax
cmpl $0xa, %eax
ja 0x10c37
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x31acf(%rip), %rcx     # 0x422ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x2, 0x44(%r12)
jne 0x10cb7
movq 0x48(%r12), %rax
movq (%rax), %r13
movq 0x8(%rax), %r12
movq 0x68(%r13), %rax
movq %rax, -0x70(%rbp)
movq 0x68(%r12), %rax
movq %rax, -0x78(%rbp)
leaq -0x68(%rbp), %rdi
callq 0xd03d
leaq -0xb8(%rbp), %rdi
callq 0xd03d
leaq -0xf8(%rbp), %rdi
callq 0xd03d
movq %r15, %rdi
movq %r14, %rsi
leaq -0x68(%rbp), %rdx
movq %r13, %rcx
callq 0xde8a
leaq -0x58(%rbp), %rsi
movq %r14, %rdi
callq 0x788c
movq %r15, %rdi
movq %r14, %rsi
leaq -0xb8(%rbp), %r13
movq %r13, %rdx
movq %r12, %rcx
callq 0xde8a
leaq -0xa8(%rbp), %rsi
movq %r14, %rdi
callq 0x788c
movq %r14, %rdi
movq %r13, %rsi
callq 0x788c
movq %r15, %rdi
leaq -0xf8(%rbp), %r12
movq %r12, %rsi
movq -0x70(%rbp), %rdx
movq %r13, %rcx
movq -0x78(%rbp), %r8
callq 0xd093
leaq -0xe8(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x788c
movq %r14, %rdi
movq %r12, %rsi
callq 0x788c
leaq -0x58(%rbp), %rax
movq 0x28(%rax), %rdx
testq %rdx, %rdx
leaq 0x335ae(%rip), %r14     # 0x43eba
cmoveq %r14, %rdx
movq 0x18(%r15), %rcx
testq %rcx, %rcx
cmoveq %r14, %rcx
leaq 0x32808(%rip), %rsi     # 0x4312a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x7b31
movq 0x18(%r15), %rsi
testq %rsi, %rsi
cmoveq %r14, %rsi
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x75cf
leaq -0x68(%rbp), %rdi
callq 0xd787
leaq -0xb8(%rbp), %rdi
callq 0xd787
movq %r12, %rdi
jmp 0x10c1e
cmpl $0x2, 0x44(%r12)
jne 0x10c3b
leaq -0xb8(%rbp), %r13
movq %r13, %rdi
callq 0x7548
leaq -0x68(%rbp), %rdi
callq 0xd03d
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0x68(%rbp), %r15
movq %r15, %rcx
movq %r12, %r8
callq 0x11254
jmp 0x10bb2
cmpl $0x2, 0x44(%r12)
jne 0x10c5a
leaq -0xb8(%rbp), %r13
movq %r13, %rdi
callq 0x7548
leaq -0x68(%rbp), %rdi
callq 0xd03d
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0x68(%rbp), %r15
movq %r15, %rcx
movq %r12, %r8
callq 0x12044
jmp 0x10bb2
cmpl $0x2, 0x44(%r12)
jne 0x10c79
leaq -0xb8(%rbp), %r13
movq %r13, %rdi
callq 0x7548
leaq -0x68(%rbp), %rdi
callq 0xd03d
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0x68(%rbp), %r15
movq %r15, %rcx
movq %r12, %r8
callq 0x11bfd
jmp 0x10bb2
cmpl $0x2, 0x44(%r12)
jne 0x10c98
leaq -0xb8(%rbp), %r13
movq %r13, %rdi
callq 0x7548
leaq -0x68(%rbp), %rdi
callq 0xd03d
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0x68(%rbp), %r15
movq %r15, %rcx
movq %r12, %r8
callq 0x10fa3
jmp 0x10bb2
cmpl $0x2, 0x44(%r12)
je 0x10b82
leaq 0x3b1de(%rip), %rdi     # 0x4bc55
leaq 0x3189a(%rip), %rsi     # 0x42318
leaq 0x3320c(%rip), %rcx     # 0x43c91
movl $0xe05, %edx            # imm = 0xE05
callq 0x30a0
cmpl $0x2, 0x44(%r12)
jne 0x10cd6
leaq -0xb8(%rbp), %r13
movq %r13, %rdi
callq 0x7548
leaq -0x68(%rbp), %rdi
callq 0xd03d
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0x68(%rbp), %r15
movq %r15, %rcx
movq %r12, %r8
callq 0x117b6
jmp 0x10bb2
cmpl $0x2, 0x44(%r12)
jne 0x10cf5
leaq -0xb8(%rbp), %r13
movq %r13, %rdi
callq 0x7548
leaq -0x68(%rbp), %rdi
callq 0xd03d
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0x68(%rbp), %r15
movq %r15, %rcx
movq %r12, %r8
callq 0x11505
jmp 0x10bb2
cmpl $0x2, 0x44(%r12)
je 0x10b82
leaq 0x3b135(%rip), %rdi     # 0x4bc55
leaq 0x317f1(%rip), %rsi     # 0x42318
leaq 0x33163(%rip), %rcx     # 0x43c91
movl $0xdff, %edx            # imm = 0xDFF
callq 0x30a0
cmpl $0x2, 0x44(%r12)
jne 0x10d14
leaq -0xb8(%rbp), %r13
movq %r13, %rdi
callq 0x7548
leaq -0x68(%rbp), %rdi
callq 0xd03d
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0x68(%rbp), %r15
movq %r15, %rcx
movq %r12, %r8
callq 0x1229a
jmp 0x10bb2
cmpl $0x2, 0x44(%r12)
jne 0x10d33
leaq -0xb8(%rbp), %r13
movq %r13, %rdi
callq 0x7548
leaq -0x68(%rbp), %rdi
callq 0xd03d
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
leaq -0x68(%rbp), %r15
movq %r15, %rcx
movq %r12, %r8
callq 0x124f0
leaq -0x58(%rbp), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x788c
movq %r14, %rdi
movq %r15, %rsi
callq 0x788c
movq 0x8(%r13), %rdx
testq %rdx, %rdx
leaq 0x332e0(%rip), %r14     # 0x43eba
cmoveq %r14, %rdx
movq 0x18(%r12), %rcx
testq %rcx, %rcx
cmoveq %r14, %rcx
leaq 0x32539(%rip), %rsi     # 0x4312a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x7b31
movq 0x18(%r12), %rsi
testq %rsi, %rsi
cmoveq %r14, %rsi
addq $0x20, %rbx
movq %rbx, %rdi
callq 0x75cf
movq %r13, %rdi
callq 0x7a38
movq %r15, %rdi
callq 0xd787
movb $0x1, %al
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x10c25
leaq 0x3b013(%rip), %rdi     # 0x4bc55
leaq 0x316cf(%rip), %rsi     # 0x42318
leaq 0x33041(%rip), %rcx     # 0x43c91
movl $0xdf3, %edx            # imm = 0xDF3
callq 0x30a0
leaq 0x3aff4(%rip), %rdi     # 0x4bc55
leaq 0x316b0(%rip), %rsi     # 0x42318
leaq 0x33022(%rip), %rcx     # 0x43c91
movl $0xe11, %edx            # imm = 0xE11
callq 0x30a0
leaq 0x3afd5(%rip), %rdi     # 0x4bc55
leaq 0x31691(%rip), %rsi     # 0x42318
leaq 0x33003(%rip), %rcx     # 0x43c91
movl $0xde7, %edx            # imm = 0xDE7
callq 0x30a0
leaq 0x3afb6(%rip), %rdi     # 0x4bc55
leaq 0x31672(%rip), %rsi     # 0x42318
leaq 0x32fe4(%rip), %rcx     # 0x43c91
movl $0xded, %edx            # imm = 0xDED
callq 0x30a0
leaq 0x3af97(%rip), %rdi     # 0x4bc55
leaq 0x31653(%rip), %rsi     # 0x42318
leaq 0x32fc5(%rip), %rcx     # 0x43c91
movl $0xdad, %edx            # imm = 0xDAD
callq 0x30a0
leaq 0x3af78(%rip), %rdi     # 0x4bc55
leaq 0x31634(%rip), %rsi     # 0x42318
leaq 0x32fa6(%rip), %rcx     # 0x43c91
movl $0xde1, %edx            # imm = 0xDE1
callq 0x30a0
leaq 0x3af59(%rip), %rdi     # 0x4bc55
leaq 0x31615(%rip), %rsi     # 0x42318
leaq 0x32f87(%rip), %rcx     # 0x43c91
movl $0xdf9, %edx            # imm = 0xDF9
callq 0x30a0
leaq 0x3af3a(%rip), %rdi     # 0x4bc55
leaq 0x315f6(%rip), %rsi     # 0x42318
leaq 0x32f68(%rip), %rcx     # 0x43c91
movl $0xe17, %edx            # imm = 0xE17
callq 0x30a0
leaq 0x3af1b(%rip), %rdi     # 0x4bc55
leaq 0x315d7(%rip), %rsi     # 0x42318
leaq 0x32f49(%rip), %rcx     # 0x43c91
movl $0xe0b, %edx            # imm = 0xE0B
callq 0x30a0