// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/evaluate.c
// Function: evaluate_ptr_sub
static struct symbol *evaluate_ptr_sub(struct expression *expr)
{
	const char *typediff;
	struct symbol *ltype, *rtype;
	struct expression *l = expr->left;
	struct expression *r = expr->right;
	struct symbol *lbase;

	classify_type(degenerate(l), &ltype);
	classify_type(degenerate(r), &rtype);

	lbase = examine_pointer_target(ltype);
	examine_pointer_target(rtype);
	typediff = type_difference(&ltype->ctype, &rtype->ctype,
				   target_qualifiers(rtype),
				   target_qualifiers(ltype));
	if (typediff)
		expression_error(expr, "subtraction of different types can't work (%s)", typediff);

	if (is_function(lbase)) {
		expression_error(expr, "subtraction of functions? Share your drugs");
		return NULL;
	}

	expr->ctype = ssize_t_ctype;
	if (lbase->bit_size > bits_in_char) {
		struct expression *sub = alloc_expression(expr->pos, EXPR_BINOP);
		struct expression *div = expr;
		struct expression *val = alloc_expression(expr->pos, EXPR_VALUE);
		unsigned long value = bits_to_bytes(lbase->bit_size);

		val->ctype = size_t_ctype;
		val->value = value;

		if (value & (value-1)) {
			if (Wptr_subtraction_blows) {
				warning(expr->pos, "potentially expensive pointer subtraction");
				info(expr->pos, "    '%s' has a non-power-of-2 size: %lu", show_typename(lbase), value);
			}
		}

		sub->op = '-';
		sub->ctype = ssize_t_ctype;
		sub->left = l;
		sub->right = r;

		div->op = '/';
		div->left = sub;
		div->right = val;
	}
		
	return ssize_t_ctype;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
callq 0x4c1c0
movq %rax, %rdi
leaq -0x20(%rbp), %rsi
callq 0x4bf20
movq -0x38(%rbp), %rdi
callq 0x4c1c0
movq %rax, %rdi
leaq -0x28(%rbp), %rsi
callq 0x4bf20
movq -0x20(%rbp), %rdi
callq 0x40260
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rdi
callq 0x40260
movq -0x20(%rbp), %rax
addq $0x48, %rax
addq $0x18, %rax
movq %rax, -0x78(%rbp)
movq -0x28(%rbp), %rax
addq $0x48, %rax
addq $0x18, %rax
movq %rax, -0x70(%rbp)
movq -0x28(%rbp), %rdi
callq 0x52670
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rdi
callq 0x52670
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq %rax, %rcx
callq 0x4ad70
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x52452
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x19935(%rip), %rsi     # 0x6bd80
movb $0x0, %al
callq 0x17030
movq -0x40(%rbp), %rdi
callq 0x525f0
cmpl $0x0, %eax
je 0x5247f
movq -0x10(%rbp), %rdi
leaq 0x19944(%rip), %rsi     # 0x6bdaf
movb $0x0, %al
callq 0x17030
movq $0x0, -0x8(%rbp)
jmp 0x525d8
leaq 0x38172(%rip), %rax     # 0x8a5f8
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x40(%rbp), %rax
movl 0x50(%rax), %eax
leaq 0x38231(%rip), %rcx     # 0x8a6d0
cmpl (%rcx), %eax
jle 0x525ca
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x5, %esi
callq 0x50ab0
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x1, %esi
callq 0x50ab0
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rax
movl 0x50(%rax), %edi
callq 0x513e0
cltq
movq %rax, -0x60(%rbp)
leaq 0x380fc(%rip), %rax     # 0x8a5f0
movq (%rax), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x60(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x60(%rbp), %rax
movq -0x60(%rbp), %rcx
subq $0x1, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0x52572
leaq 0x3ace1(%rip), %rax     # 0x8d208
cmpl $0x0, (%rax)
je 0x52570
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x1989f(%rip), %rsi     # 0x6bdda
movb $0x0, %al
callq 0x16d80
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x40(%rbp), %rdi
callq 0x33340
movq %rax, %rdx
movq -0x80(%rbp), %rax
movq -0x60(%rbp), %rcx
movq 0x8(%rax), %rdi
leaq 0x1989b(%rip), %rsi     # 0x6be04
movb $0x0, %al
callq 0x16c10
jmp 0x52572
movq -0x48(%rbp), %rax
movl $0x2d, 0x4(%rax)
leaq 0x38074(%rip), %rax     # 0x8a5f8
movq (%rax), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x30(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x50(%rbp), %rax
movl $0x2f, 0x4(%rax)
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x58(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x28(%rax)
leaq 0x38027(%rip), %rax     # 0x8a5f8
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)