// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x20(%rdi), %r15
movq 0x28(%rdi), %r12
movq %r15, %rdi
callq 0x32bf6
movq %rax, %r14
movzbl (%rax), %eax
cmpl $0x3, %eax
jne 0x3386b
movq 0x60(%r14), %r14
movzbl (%r14), %eax
cmpl $0xa, %eax
jne 0x3388b
movq %r14, %rdi
callq 0x2b0b8
movq %rax, %r14
movzbl (%rax), %eax
cmpl $0x3, %eax
jne 0x3388b
movq 0x60(%r14), %r14
movzbl (%r14), %eax
cmpl $0x9, %eax
jne 0x33898
movq 0x60(%r14), %r14
movzbl (%r14), %eax
cmpl $0x2, %eax
jne 0x338b3
movq 0x60(%r14), %rcx
cmpq 0x2c6e0(%rip), %rcx     # 0x5ff88
je 0x338c5
cmpq 0x2c69f(%rip), %rcx     # 0x5ff50
je 0x338cf
movl %eax, %eax
leaq 0x162f4(%rip), %rcx     # 0x49bb0
movl (%rcx,%rax,4), %eax
movl %eax, 0x14(%rsp)
jmp 0x338d7
movl $0x1, 0x14(%rsp)
jmp 0x338d7
movl $0x9, 0x14(%rsp)
movq %r12, %rdi
callq 0x32bf6
movq %rax, %r13
movzbl (%rax), %eax
cmpl $0x3, %eax
jne 0x338f3
movq 0x60(%r13), %r13
movzbl (%r13), %eax
cmpl $0xa, %eax
jne 0x33914
movq %r13, %rdi
callq 0x2b0b8
movq %rax, %r13
movzbl (%rax), %eax
cmpl $0x3, %eax
jne 0x33914
movq 0x60(%r13), %r13
movzbl (%r13), %eax
cmpl $0x9, %eax
jne 0x33922
movq 0x60(%r13), %r13
movzbl (%r13), %eax
cmpl $0x2, %eax
jne 0x3393d
movq 0x60(%r13), %rcx
cmpq 0x2c656(%rip), %rcx     # 0x5ff88
je 0x3394b
cmpq 0x2c615(%rip), %rcx     # 0x5ff50
je 0x33952
movl %eax, %eax
leaq 0x1626a(%rip), %rcx     # 0x49bb0
movl (%rcx,%rax,4), %ebp
jmp 0x33957
movl $0x1, %ebp
jmp 0x33957
movl $0x9, %ebp
cmpq 0x2c622(%rip), %r14     # 0x5ff80
jne 0x3398a
cmpq 0x2c619(%rip), %r13     # 0x5ff80
jne 0x3398a
movb $0x30, 0x1(%rbx)
leaq 0x37dc4(%rip), %r15     # 0x6b738
movq %r15, 0x10(%rbx)
movq %r15, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%r15), %rax
testb $-0x80, 0x6a(%rax)
jne 0x3399f
movq 0x10(%r12), %rax
testb $-0x80, 0x6a(%rax)
je 0x339b1
movq 0x8(%rbx), %rdi
leaq 0x16787(%rip), %rsi     # 0x4a131
xorl %eax, %eax
callq 0x118fc
movl (%r15), %eax
movq %r12, 0x20(%rsp)
andl (%r12), %eax
andl $0xb400, %eax           # imm = 0xB400
movb %ah, 0x1(%rbx)
movl %ebp, %r12d
movl 0x14(%rsp), %ecx
andl %ecx, %r12d
testb $0x1, %r12b
jne 0x33ae8
movl %ebp, %eax
orl %ecx, %eax
testb $0x10, %al
je 0x33ba1
movl 0x4(%rbx), %eax
andl $-0x2, %eax
cmpl $0x10a, %eax            # imm = 0x10A
jne 0x33b9b
movq 0x10(%r15), %rax
movl $0x1, %esi
movl $0x1, %r8d
cmpq 0x2c5ac(%rip), %rax     # 0x5ffb8
je 0x33a31
xorl %r8d, %r8d
testb $0x10, 0x1(%r15)
je 0x33a31
movq %r15, %rdi
callq 0xf54a
movl $0x1, %esi
xorl %r8d, %r8d
testl %eax, %eax
setne %r8b
addl %r8d, %r8d
movq 0x20(%rsp), %rdi
movq 0x10(%rdi), %rax
cmpq 0x2c577(%rip), %rax     # 0x5ffb8
movl %r8d, 0x18(%rsp)
je 0x33a64
xorl %esi, %esi
testb $0x10, 0x1(%rdi)
je 0x33a64
callq 0xf54a
movl 0x18(%rsp), %r8d
xorl %esi, %esi
testl %eax, %eax
setne %sil
addl %esi, %esi
cmpl $0x2, %r8d
setne %cl
leaq 0x2cb4e(%rip), %rax     # 0x605c0
movl (%rax), %eax
testl %eax, %eax
sete %dl
orb %cl, %dl
movl %esi, 0x1c(%rsp)
jne 0x33aa5
movq 0x8(%r15), %rdi
leaq 0x164a8(%rip), %rsi     # 0x49f34
xorl %eax, %eax
callq 0x118fc
movl 0x18(%rsp), %r8d
movl 0x1c(%rsp), %esi
leaq 0x2cb1d(%rip), %rax     # 0x605c0
movl (%rax), %eax
cmpl $0x2, %esi
jne 0x33ace
testl %eax, %eax
je 0x33ace
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x16476(%rip), %rsi     # 0x49f34
xorl %eax, %eax
callq 0x118fc
movl 0x18(%rsp), %r8d
movl 0x1c(%rsp), %esi
testl %r8d, %r8d
je 0x33b52
testl %esi, %esi
je 0x33b52
xorl %eax, %eax
cmpl $0x10a, 0x4(%rbx)       # imm = 0x10A
sete %al
movb $0x1, (%rbx)
jmp 0x33b67
movl 0x4(%rbx), %edi
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r13, (%rsp)
movl %ebp, %r8d
movq %r14, %r9
callq 0x36814
movq %rax, %r14
movq 0x20(%rbx), %rdi
movq %rax, %rsi
callq 0x32aa9
movq %rax, 0x20(%rbx)
movq 0x28(%rbx), %rdi
movq %r14, %rsi
callq 0x32aa9
movq %rax, 0x28(%rbx)
testb $0x40, 0x69(%r14)
je 0x3396d
movl 0x4(%rbx), %eax
cmpl $0x3c, %eax
je 0x33b70
cmpl $0x108, %eax            # imm = 0x108
je 0x33b4b
cmpl $0x3e, %eax
jne 0x33b77
movl $0x11a, %ecx            # imm = 0x11A
jmp 0x33b84
movl $0x11b, %ecx            # imm = 0x11B
jmp 0x33b84
testl %r8d, %r8d
je 0x33b8c
andl $0x10, %ebp
je 0x33b8c
movq %r15, %rdi
movq %r13, %rsi
callq 0x32aa9
movq %rax, 0x20(%rbx)
jmp 0x3396d
movl $0x119, %ecx            # imm = 0x119
jmp 0x33b84
cmpl $0x109, %eax            # imm = 0x109
movl $0x11c, %ecx            # imm = 0x11C
cmovnel %eax, %ecx
movl %ecx, 0x4(%rbx)
jmp 0x3396d
testl %esi, %esi
je 0x33b9b
andl $0x10, 0x14(%rsp)
jne 0x33ce2
testb $0x10, %r12b
jne 0x33bb5
movq %rbx, %rdi
callq 0x37201
leaq 0x38d08(%rip), %r15     # 0x6c8b8
jmp 0x33978
movl 0x4(%rbx), %eax
cmpl $0x3c, %eax
je 0x33bd7
cmpl $0x108, %eax            # imm = 0x108
je 0x33bd0
cmpl $0x3e, %eax
jne 0x33bde
movl $0x11a, %ecx            # imm = 0x11A
jmp 0x33beb
movl $0x11b, %ecx            # imm = 0x11B
jmp 0x33beb
movl $0x119, %ecx            # imm = 0x119
jmp 0x33beb
cmpl $0x109, %eax            # imm = 0x109
movl $0x11c, %ecx            # imm = 0x11C
cmovnel %eax, %ecx
movl %ecx, 0x4(%rbx)
movq %r14, %rdi
callq 0x2baa4
movq %rax, %r12
movq %r13, %rdi
callq 0x2baa4
movl 0x4(%rbx), %ecx
andl $-0x2, %ecx
cmpl $0x10a, %ecx            # imm = 0x10A
jne 0x33c23
movq 0x80(%r14), %rcx
cmpq 0x80(%r13), %rcx
je 0x33cc7
movq 0x60(%r13), %rax
movq 0x68(%r13), %rdx
andl $0x11000e00, %edx       # imm = 0x11000E00
testq %rax, %rax
je 0x33c3f
xorl %ecx, %ecx
cmpb $0x6, (%rax)
cmoveq %rcx, %rdx
leaq 0x60(%r14), %rdi
leaq 0x60(%r13), %rsi
movq 0x60(%r14), %rax
movq 0x68(%r14), %rcx
andl $0x11000e00, %ecx       # imm = 0x11000E00
testq %rax, %rax
je 0x33c64
xorl %r8d, %r8d
cmpb $0x6, (%rax)
cmoveq %r8, %rcx
callq 0x31898
testq %rax, %rax
je 0x3396d
leaq 0x1652c(%rip), %rsi     # 0x4a1a5
xorl %r15d, %r15d
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x11b04
movq %r14, %rdi
callq 0x237c5
movq 0x8(%rbx), %rdi
leaq 0x14beb(%rip), %r14     # 0x48887
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1178c
movq %r13, %rdi
callq 0x237c5
movq 0x8(%rbx), %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1178c
jmp 0x33978
cmpq 0x2c27a(%rip), %r12     # 0x5ff48
je 0x33ce2
cmpq 0x2c271(%rip), %rax     # 0x5ff48
jne 0x33c23
jmp 0x33b5c
movq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x32aa9
movq %rax, 0x28(%rbx)
jmp 0x3396d