// File: /workspace/github_c_makefile_star2_O2/saltyJeff[P]uClibcpp/extra/config/./expr.c
// Function: expr_trans_compare
struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym)
{
	struct expr *e1, *e2;

	if (!e) {
		e = expr_alloc_symbol(sym);
		if (type == E_UNEQUAL)
			e = expr_alloc_one(E_NOT, e);
		return e;
	}
	switch (e->type) {
	case E_AND:
		e1 = expr_trans_compare(e->left.expr, E_EQUAL, sym);
		e2 = expr_trans_compare(e->right.expr, E_EQUAL, sym);
		if (sym == &symbol_yes)
			e = expr_alloc_two(E_AND, e1, e2);
		if (sym == &symbol_no)
			e = expr_alloc_two(E_OR, e1, e2);
		if (type == E_UNEQUAL)
			e = expr_alloc_one(E_NOT, e);
		return e;
	case E_OR:
		e1 = expr_trans_compare(e->left.expr, E_EQUAL, sym);
		e2 = expr_trans_compare(e->right.expr, E_EQUAL, sym);
		if (sym == &symbol_yes)
			e = expr_alloc_two(E_OR, e1, e2);
		if (sym == &symbol_no)
			e = expr_alloc_two(E_AND, e1, e2);
		if (type == E_UNEQUAL)
			e = expr_alloc_one(E_NOT, e);
		return e;
	case E_NOT:
		return expr_trans_compare(e->left.expr, type == E_EQUAL ? E_UNEQUAL : E_EQUAL, sym);
	case E_UNEQUAL:
	case E_EQUAL:
		if (type == E_EQUAL) {
			if (sym == &symbol_yes)
				return expr_copy(e);
			if (sym == &symbol_mod)
				return expr_alloc_symbol(&symbol_no);
			if (sym == &symbol_no)
				return expr_alloc_one(E_NOT, expr_copy(e));
		} else {
			if (sym == &symbol_yes)
				return expr_alloc_one(E_NOT, expr_copy(e));
			if (sym == &symbol_mod)
				return expr_alloc_symbol(&symbol_yes);
			if (sym == &symbol_no)
				return expr_copy(e);
		}
		break;
	case E_SYMBOL:
		return expr_alloc_comp(type, e->left.sym, sym);
	case E_CHOICE:
	case E_RANGE:
	case E_NONE:
		/* panic */;
	}
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x1605(%rip), %rax      # 0xa5c4
testq %rbx, %rbx
je 0x902b
movl (%rbx), %ecx
decl %ecx
cmpl $0x6, %ecx
ja 0x90ef
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x8(%rbx), %rbx
xorl %ecx, %ecx
cmpl $0x4, %ebp
sete %cl
orl $0x4, %ecx
movl %ecx, %ebp
jmp 0x8fbf
leaq 0xb2a4(%rip), %rax      # 0x14298
cmpl $0x4, %ebp
jne 0x90d2
cmpq %rax, %r14
je 0x9138
leaq 0xb2fb(%rip), %rax      # 0x14308
cmpq %rax, %r14
je 0x9148
leaq 0xb20b(%rip), %rax      # 0x14228
cmpq %rax, %r14
jne 0x90ef
jmp 0x911d
movq %r14, %rdi
callq 0x5567
jmp 0x9101
movq 0x8(%rbx), %rdi
pushq $0x4
popq %r12
movl %r12d, %esi
movq %r14, %rdx
callq 0x8fa8
movq %rax, %r15
movq 0x10(%rbx), %rdi
movl %r12d, %esi
movq %r14, %rdx
callq 0x8fa8
leaq 0xb234(%rip), %rcx      # 0x14298
cmpq %rcx, %r14
je 0x90b8
leaq 0xb1b8(%rip), %rcx      # 0x14228
cmpq %rcx, %r14
jne 0x9104
jmp 0x90f3
movq 0x8(%rbx), %rdi
pushq $0x4
popq %r12
movl %r12d, %esi
movq %r14, %rdx
callq 0x8fa8
movq %rax, %r15
movq 0x10(%rbx), %rdi
movl %r12d, %esi
movq %r14, %rdx
callq 0x8fa8
leaq 0xb1f1(%rip), %rcx      # 0x14298
cmpq %rcx, %r14
je 0x90f3
leaq 0xb175(%rip), %rcx      # 0x14228
cmpq %rcx, %r14
jne 0x9104
pushq $0x1
jmp 0x90f5
movq 0x8(%rbx), %rsi
movl %ebp, %edi
movq %r14, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5293
cmpq %rax, %r14
je 0x911d
leaq 0xb22a(%rip), %rax      # 0x14308
cmpq %rax, %r14
je 0x9151
leaq 0xb13e(%rip), %rax      # 0x14228
cmpq %rax, %r14
je 0x9138
xorl %ebx, %ebx
jmp 0x9111
pushq $0x2
popq %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x55a2
movq %rax, %rbx
cmpl $0x5, %ebp
jne 0x9111
pushq $0x3
popq %rdi
movq %rbx, %rsi
jmp 0x912b
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x7dc5
pushq $0x3
popq %rdi
movq %rax, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5582
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x7dc5
leaq 0xb0d9(%rip), %rdi      # 0x14228
jmp 0x9158
leaq 0xb140(%rip), %rdi      # 0x14298
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5567