// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/linearize.c
// Function: linearize_assignment
static pseudo_t linearize_assignment(struct entrypoint *ep, struct expression *expr)
{
	struct access_data ad = { NULL, };
	struct expression *target = expr->left;
	struct expression *src = expr->right;
	struct symbol *ctype;
	pseudo_t value;

	value = linearize_expression(ep, src);
	if (!target || !linearize_address_gen(ep, target, &ad))
		return value;
	if (expr->op != '=') {
		pseudo_t oldvalue = linearize_load_gen(ep, &ad);
		pseudo_t dst;
		static const int op_trans[] = {
			[SPECIAL_ADD_ASSIGN - SPECIAL_BASE] = OP_ADD,
			[SPECIAL_SUB_ASSIGN - SPECIAL_BASE] = OP_SUB,
			[SPECIAL_MUL_ASSIGN - SPECIAL_BASE] = OP_MUL,
			[SPECIAL_DIV_ASSIGN - SPECIAL_BASE] = OP_DIVU,
			[SPECIAL_MOD_ASSIGN - SPECIAL_BASE] = OP_MODU,
			[SPECIAL_SHL_ASSIGN - SPECIAL_BASE] = OP_SHL,
			[SPECIAL_SHR_ASSIGN - SPECIAL_BASE] = OP_LSR,
			[SPECIAL_AND_ASSIGN - SPECIAL_BASE] = OP_AND,
			[SPECIAL_OR_ASSIGN  - SPECIAL_BASE] = OP_OR,
			[SPECIAL_XOR_ASSIGN - SPECIAL_BASE] = OP_XOR
		};
		int opcode;

		if (!src)
			return VOID;

		ctype = src->ctype;
		oldvalue = cast_pseudo(ep, oldvalue, target->ctype, ctype);
		opcode = map_opcode(op_trans[expr->op - SPECIAL_BASE], ctype);
		dst = add_binary_op(ep, ctype, opcode, oldvalue, value);
		taint_undefined_behaviour(dst->def);
		value = cast_pseudo(ep, dst, ctype, expr->ctype);
	}
	value = linearize_store_gen(ep, value, &ad);
	return value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x11130
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x1bb90
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x1d356
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x1fe10
cmpl $0x0, %eax
jne 0x1d363
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1d44a
movq -0x18(%rbp), %rax
cmpl $0x3d, 0x4(%rax)
je 0x1d42d
movq -0x10(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x1fec0
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x1d399
leaq 0x6ea20(%rip), %rax     # 0x8bdb0
movq %rax, -0x8(%rbp)
jmp 0x1d44a
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x50(%rbp), %rcx
callq 0x1f5f0
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
subl $0x100, %eax            # imm = 0x100
movslq %eax, %rcx
leaq 0x46088(%rip), %rax     # 0x63460
movl (%rax,%rcx,4), %edi
movq -0x50(%rbp), %rsi
callq 0x1f2f0
movl %eax, -0x6c(%rbp)
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl -0x6c(%rbp), %edx
movq -0x60(%rbp), %rcx
movq -0x58(%rbp), %r8
callq 0x1de90
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x1fb60
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
callq 0x1f5f0
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x1d790
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)