// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/expand.c
// Function: simplify_cmp_binop
static int simplify_cmp_binop(struct expression *expr, struct symbol *ctype)
{
	struct expression *left = expr->left, *right = expr->right;
	unsigned long long l, r, mask;
	signed long long sl, sr;

	if (left->type != EXPR_VALUE || right->type != EXPR_VALUE)
		return 0;
	l = left->value; r = right->value;
	mask = 1ULL << (ctype->bit_size-1);
	sl = l; sr = r;
	if (sl & mask)
		sl |= ~(mask-1);
	if (sr & mask)
		sr |= ~(mask-1);
	switch (expr->op) {
	case '<':		expr->value = sl < sr; break;
	case '>':		expr->value = sl > sr; break;
	case SPECIAL_LTE:	expr->value = sl <= sr; break;
	case SPECIAL_GTE:	expr->value = sl >= sr; break;
	case SPECIAL_EQUAL:	expr->value = l == r; break;
	case SPECIAL_NOTEQUAL:	expr->value = l != r; break;
	case SPECIAL_UNSIGNED_LT:expr->value = l < r; break;
	case SPECIAL_UNSIGNED_GT:expr->value = l > r; break;
	case SPECIAL_UNSIGNED_LTE:expr->value = l <= r; break;
	case SPECIAL_UNSIGNED_GTE:expr->value = l >= r; break;
	}
	expr->type = EXPR_VALUE;
	expr->taint = left->taint | right->taint;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0xff, %eax
cmpl $0x1, %eax
jne 0x13ab4
movq -0x28(%rbp), %rax
movl (%rax), %eax
andl $0xff, %eax
cmpl $0x1, %eax
je 0x13ac0
movl $0x0, -0x4(%rbp)
jmp 0x13d48
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movl 0x50(%rax), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
andq -0x40(%rbp), %rax
cmpq $0x0, %rax
je 0x13b24
movq -0x40(%rbp), %rax
subq $0x1, %rax
xorq $-0x1, %rax
orq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rax
andq -0x40(%rbp), %rax
cmpq $0x0, %rax
je 0x13b46
movq -0x40(%rbp), %rax
subq $0x1, %rax
xorq $-0x1, %rax
orq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x54(%rbp)
subl $0x3c, %eax
je 0x13bec
jmp 0x13b5b
movl -0x54(%rbp), %eax
subl $0x3e, %eax
je 0x13c0c
jmp 0x13b69
movl -0x54(%rbp), %eax
subl $0x108, %eax            # imm = 0x108
je 0x13c2c
jmp 0x13b79
movl -0x54(%rbp), %eax
subl $0x109, %eax            # imm = 0x109
je 0x13c4c
jmp 0x13b89
movl -0x54(%rbp), %eax
subl $0x10a, %eax            # imm = 0x10A
je 0x13c6c
jmp 0x13b99
movl -0x54(%rbp), %eax
subl $0x10b, %eax            # imm = 0x10B
je 0x13c8c
jmp 0x13ba9
movl -0x54(%rbp), %eax
subl $0x119, %eax            # imm = 0x119
je 0x13ca9
jmp 0x13bb9
movl -0x54(%rbp), %eax
subl $0x11a, %eax            # imm = 0x11A
je 0x13cc6
jmp 0x13bc9
movl -0x54(%rbp), %eax
subl $0x11b, %eax            # imm = 0x11B
je 0x13ce3
jmp 0x13bd9
movl -0x54(%rbp), %eax
subl $0x11c, %eax            # imm = 0x11C
je 0x13d00
jmp 0x13d1b
movq -0x48(%rbp), %rax
cmpq -0x50(%rbp), %rax
setl %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x13d1b
movq -0x48(%rbp), %rax
cmpq -0x50(%rbp), %rax
setg %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x13d1b
movq -0x48(%rbp), %rax
cmpq -0x50(%rbp), %rax
setle %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x13d1b
movq -0x48(%rbp), %rax
cmpq -0x50(%rbp), %rax
setge %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x13d1b
movq -0x30(%rbp), %rax
cmpq -0x38(%rbp), %rax
sete %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x13d1b
movq -0x30(%rbp), %rax
cmpq -0x38(%rbp), %rax
setne %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x13d1b
movq -0x30(%rbp), %rax
cmpq -0x38(%rbp), %rax
setb %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x13d1b
movq -0x30(%rbp), %rax
cmpq -0x38(%rbp), %rax
seta %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x13d1b
movq -0x30(%rbp), %rax
cmpq -0x38(%rbp), %rax
setbe %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x13d1b
movq -0x30(%rbp), %rax
cmpq -0x38(%rbp), %rax
setae %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
orl $0x1, %ecx
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movl 0x28(%rax), %ecx
movq -0x28(%rbp), %rax
orl 0x28(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x28(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)