// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/evaluate.c
// Function: evaluate_compare
static struct symbol *evaluate_compare(struct expression *expr)
{
	struct expression *left = expr->left, *right = expr->right;
	struct symbol *ltype, *rtype, *lbase, *rbase;
	int lclass = classify_type(degenerate(left), &ltype);
	int rclass = classify_type(degenerate(right), &rtype);
	struct symbol *ctype;
	const char *typediff;

	/* Type types? */
	if (is_type_type(ltype) && is_type_type(rtype)) {
		/*
		 * __builtin_types_compatible_p() yields an integer
		 * constant expression
		 */
		expr->flags = CEF_SET_ICE;
		goto OK;
	}

	if (is_safe_type(left->ctype) || is_safe_type(right->ctype))
		warning(expr->pos, "testing a 'safe expression'");

	expr->flags = left->flags & right->flags & ~CEF_CONST_MASK & ~CEF_ADDR;

	/* number on number */
	if (lclass & rclass & TYPE_NUM) {
		ctype = usual_conversions(expr->op, expr->left, expr->right,
					  lclass, rclass, ltype, rtype);
		expr->left = cast_to(expr->left, ctype);
		expr->right = cast_to(expr->right, ctype);
		if (ctype->ctype.modifiers & MOD_UNSIGNED)
			expr->op = modify_for_unsigned(expr->op);
		goto OK;
	}

	/* at least one must be a pointer */
	if (!((lclass | rclass) & TYPE_PTR))
		return bad_expr_type(expr);

	/* equality comparisons can be with null pointer constants */
	if (expr->op == SPECIAL_EQUAL || expr->op == SPECIAL_NOTEQUAL) {
		int is_null1 = is_null_pointer_constant(left);
		int is_null2 = is_null_pointer_constant(right);
		if (is_null1 == NULL_ZERO)
			bad_null(left);
		if (is_null2 == NULL_ZERO)
			bad_null(right);
		if (is_null1 && is_null2) {
			int positive = expr->op == SPECIAL_EQUAL;
			expr->type = EXPR_VALUE;
			expr->value = positive;
			goto OK;
		}
		if (is_null1 && (rclass & TYPE_PTR)) {
			expr->left = cast_to(left, rtype);
			goto OK;
		}
		if (is_null2 && (lclass & TYPE_PTR)) {
			expr->right = cast_to(right, ltype);
			goto OK;
		}
	}
	/* both should be pointers */
	if (!(lclass & rclass & TYPE_PTR))
		return bad_expr_type(expr);
	expr->op = modify_for_unsigned(expr->op);

	lbase = examine_pointer_target(ltype);
	rbase = examine_pointer_target(rtype);

	/* they also have special treatment for pointers to void */
	if (expr->op == SPECIAL_EQUAL || expr->op == SPECIAL_NOTEQUAL) {
		if (ltype->ctype.as == rtype->ctype.as) {
			if (lbase == &void_ctype) {
				expr->right = cast_to(right, ltype);
				goto OK;
			}
			if (rbase == &void_ctype) {
				expr->left = cast_to(left, rtype);
				goto OK;
			}
		}
	}

	typediff = type_difference(&ltype->ctype, &rtype->ctype,
				   target_qualifiers(rtype),
				   target_qualifiers(ltype));
	if (!typediff)
		goto OK;

	expression_error(expr, "incompatible types in comparison expression (%s):", typediff);
	info(expr->pos, "   %s", show_typename(ltype));
	info(expr->pos, "   %s", show_typename(rtype));
	return NULL;

OK:
	/* the result is int [6.5.8(6), 6.5.9(3)]*/
	expr->ctype = &int_ctype;
	return &int_ctype;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x4c1c0
movq %rax, %rdi
leaq -0x28(%rbp), %rsi
callq 0x4bf20
movl %eax, -0x44(%rbp)
movq -0x20(%rbp), %rdi
callq 0x4c1c0
movq %rax, %rdi
leaq -0x30(%rbp), %rsi
callq 0x4bf20
movl %eax, -0x48(%rbp)
movq -0x28(%rbp), %rdi
callq 0x52990
cmpl $0x0, %eax
je 0x4cf7c
movq -0x30(%rbp), %rdi
callq 0x52990
cmpl $0x0, %eax
je 0x4cf7c
movq -0x10(%rbp), %rax
movl (%rax), %ecx
andl $0xffff00ff, %ecx       # imm = 0xFFFF00FF
orl $0x3000, %ecx           # imm = 0x3000
movl %ecx, (%rax)
jmp 0x4d374
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x68(%rax), %rax
andq $0x800000, %rax         # imm = 0x800000
cmpq $0x0, %rax
jne 0x4cfac
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x68(%rax), %rax
andq $0x800000, %rax         # imm = 0x800000
cmpq $0x0, %rax
je 0x4cfc2
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x1ee96(%rip), %rsi     # 0x6be51
movb $0x0, %al
callq 0x16d80
movq -0x18(%rbp), %rax
movl (%rax), %edx
shrl $0x8, %edx
andl $0xff, %edx
movq -0x20(%rbp), %rax
movl (%rax), %eax
shrl $0x8, %eax
andl $0xff, %eax
andl %eax, %edx
andl $-0xc, %edx
andl $-0x41, %edx
movq -0x10(%rbp), %rax
movl (%rax), %ecx
andl $0xff, %edx
shll $0x8, %edx
andl $0xffff00ff, %ecx       # imm = 0xFFFF00FF
orl %edx, %ecx
movl %ecx, (%rax)
movl -0x44(%rbp), %eax
andl -0x48(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x4d0ab
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdx
movl -0x44(%rbp), %ecx
movl -0x48(%rbp), %r8d
movq -0x28(%rbp), %r9
movq -0x30(%rbp), %rax
movq %rax, (%rsp)
callq 0x50e50
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x50(%rbp), %rsi
callq 0x4c020
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x50(%rbp), %rsi
callq 0x4c020
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x50(%rbp), %rax
movq 0x68(%rax), %rax
andq $0x4000, %rax           # imm = 0x4000
cmpq $0x0, %rax
je 0x4d0a6
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x529b0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0x4d374
movl -0x44(%rbp), %eax
orl -0x48(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0x4d0cb
movq -0x10(%rbp), %rdi
callq 0x51ed0
movq %rax, -0x8(%rbp)
jmp 0x4d38e
movq -0x10(%rbp), %rax
cmpl $0x10a, 0x4(%rax)       # imm = 0x10A
je 0x4d0e9
movq -0x10(%rbp), %rax
cmpl $0x10b, 0x4(%rax)       # imm = 0x10B
jne 0x4d1c1
movq -0x18(%rbp), %rdi
callq 0x51c70
movl %eax, -0x5c(%rbp)
movq -0x20(%rbp), %rdi
callq 0x51c70
movl %eax, -0x60(%rbp)
cmpl $0x2, -0x5c(%rbp)
jne 0x4d110
movq -0x18(%rbp), %rdi
callq 0x51ce0
cmpl $0x2, -0x60(%rbp)
jne 0x4d11f
movq -0x20(%rbp), %rdi
callq 0x51ce0
cmpl $0x0, -0x5c(%rbp)
je 0x4d163
cmpl $0x0, -0x60(%rbp)
je 0x4d163
movq -0x10(%rbp), %rax
cmpl $0x10a, 0x4(%rax)       # imm = 0x10A
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x64(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
orl $0x1, %ecx
movl %ecx, (%rax)
movslq -0x64(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x4d374
cmpl $0x0, -0x5c(%rbp)
je 0x4d191
movl -0x48(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x4d191
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x4c020
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x4d374
cmpl $0x0, -0x60(%rbp)
je 0x4d1bf
movl -0x44(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x4d1bf
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x4c020
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
jmp 0x4d374
jmp 0x4d1c1
movl -0x44(%rbp), %eax
andl -0x48(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0x4d1e1
movq -0x10(%rbp), %rdi
callq 0x51ed0
movq %rax, -0x8(%rbp)
jmp 0x4d38e
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x529b0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x28(%rbp), %rdi
callq 0x40260
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
callq 0x40260
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x10a, 0x4(%rax)       # imm = 0x10A
je 0x4d22a
movq -0x10(%rbp), %rax
cmpl $0x10b, 0x4(%rax)       # imm = 0x10B
jne 0x4d29a
movq -0x28(%rbp), %rax
movq 0x80(%rax), %rax
movq -0x30(%rbp), %rcx
cmpq 0x80(%rcx), %rax
jne 0x4d298
leaq 0x442af(%rip), %rax     # 0x914f8
cmpq %rax, -0x38(%rbp)
jne 0x4d26c
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x4c020
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
jmp 0x4d374
leaq 0x44285(%rip), %rax     # 0x914f8
cmpq %rax, -0x40(%rbp)
jne 0x4d296
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x4c020
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x4d374
jmp 0x4d298
jmp 0x4d29a
movq -0x28(%rbp), %rax
addq $0x48, %rax
addq $0x18, %rax
movq %rax, -0x80(%rbp)
movq -0x30(%rbp), %rax
addq $0x48, %rax
addq $0x18, %rax
movq %rax, -0x78(%rbp)
movq -0x30(%rbp), %rdi
callq 0x52670
movq %rax, -0x70(%rbp)
movq -0x28(%rbp), %rdi
callq 0x52670
movq -0x80(%rbp), %rdi
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq %rax, %rcx
callq 0x4ad70
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x4d2f4
jmp 0x4d374
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rdx
leaq 0x1ebc2(%rip), %rsi     # 0x6bec5
movb $0x0, %al
callq 0x17030
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x28(%rbp), %rdi
callq 0x33340
movq %rax, %rdx
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x1d130(%rip), %rsi     # 0x6a463
movb $0x0, %al
callq 0x16c10
movq -0x10(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x30(%rbp), %rdi
callq 0x33340
movq %rax, %rdx
movq -0x88(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x1d100(%rip), %rsi     # 0x6a463
movb $0x0, %al
callq 0x16c10
movq $0x0, -0x8(%rbp)
jmp 0x4d38e
movq -0x10(%rbp), %rax
leaq 0x44799(%rip), %rcx     # 0x91b18
movq %rcx, 0x10(%rax)
leaq 0x4478e(%rip), %rax     # 0x91b18
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax,%rax)