// File: /workspace/github_c_makefile_star2_O2/saltyJeff[P]uClibcpp/extra/config/./expr.c
// Function: expr_eliminate_dups2
static void expr_eliminate_dups2(enum expr_type type, struct expr **ep1, struct expr **ep2)
{
#define e1 (*ep1)
#define e2 (*ep2)
	struct expr *tmp, *tmp1, *tmp2;

	if (e1->type == type) {
		expr_eliminate_dups2(type, &e1->left.expr, &e2);
		expr_eliminate_dups2(type, &e1->right.expr, &e2);
		return;
	}
	if (e2->type == type) {
		expr_eliminate_dups2(type, &e1, &e2->left.expr);
		expr_eliminate_dups2(type, &e1, &e2->right.expr);
	}
	if (e1 == e2)
		return;

	switch (e1->type) {
	case E_OR:
		expr_eliminate_dups2(e1->type, &e1, &e1);
		// (FOO || BAR) && (!FOO && !BAR) -> n
		tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1)));
		tmp2 = expr_copy(e2);
		tmp = expr_extract_eq_and(&tmp1, &tmp2);
		if (expr_is_yes(tmp1)) {
			expr_free(e1);
			e1 = expr_alloc_symbol(&symbol_no);
			trans_count++;
		}
		expr_free(tmp2);
		expr_free(tmp1);
		expr_free(tmp);
		break;
	case E_AND:
		expr_eliminate_dups2(e1->type, &e1, &e1);
		// (FOO && BAR) || (!FOO || !BAR) -> y
		tmp1 = expr_transform(expr_alloc_one(E_NOT, expr_copy(e1)));
		tmp2 = expr_copy(e2);
		tmp = expr_extract_eq_or(&tmp1, &tmp2);
		if (expr_is_no(tmp1)) {
			expr_free(e1);
			e1 = expr_alloc_symbol(&symbol_yes);
			trans_count++;
		}
		expr_free(tmp2);
		expr_free(tmp1);
		expr_free(tmp);
		break;
	default:
		;
	}
#undef e1
#undef e2
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movl %edi, %ebp
movq (%rsi), %rsi
cmpl %edi, (%rsi)
jne 0x8945
addq $0x8, %rsi
movl %ebp, %edi
movq %r14, %rdx
callq 0x8906
movq (%rbx), %rsi
addq $0x10, %rsi
movl %ebp, %edi
movq %r14, %rdx
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x8906
movq (%r14), %rdx
cmpl %ebp, (%rdx)
jne 0x8971
addq $0x8, %rdx
movl %ebp, %edi
movq %rbx, %rsi
callq 0x8906
movq (%r14), %rdx
addq $0x10, %rdx
movl %ebp, %edi
movq %rbx, %rsi
callq 0x8906
movq (%rbx), %rsi
movq (%r14), %rdx
cmpq %rdx, %rsi
je 0x8a08
movl (%rsi), %eax
cmpl $0x2, %eax
je 0x8a13
cmpl $0x1, %eax
jne 0x8a08
pushq $0x1
popq %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x8906
movq (%rbx), %rdi
callq 0x7dc5
pushq $0x3
popq %rdi
movq %rax, %rsi
callq 0x5582
movq %rax, %rdi
callq 0x8ab2
leaq 0x10(%rsp), %r15
movq %rax, (%r15)
movq (%r14), %rdi
callq 0x7dc5
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r15, %rdi
callq 0x8e2e
movq %rax, %r14
movq (%r15), %r15
movq %r15, %rdi
callq 0x6158
testl %eax, %eax
je 0x8a7a
movq (%rbx), %rdi
callq 0x7e66
leaq 0xb830(%rip), %rdi      # 0x14228
callq 0x5567
movq %rax, (%rbx)
incl 0xd3be(%rip)            # 0x15dc4
jmp 0x8a7a
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x2
popq %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x8906
movq (%rbx), %rdi
callq 0x7dc5
pushq $0x3
popq %rdi
movq %rax, %rsi
callq 0x5582
movq %rax, %rdi
callq 0x8ab2
leaq 0x10(%rsp), %r15
movq %rax, (%r15)
movq (%r14), %rdi
callq 0x7dc5
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r15, %rdi
callq 0x8f4a
movq %rax, %r14
movq (%r15), %r15
testq %r15, %r15
je 0x8a7a
cmpl $0x7, (%r15)
jne 0x8a7a
leaq 0xb7b4(%rip), %rax      # 0x14228
cmpq %rax, 0x8(%r15)
je 0x8a9e
movq 0x8(%rsp), %rdi
callq 0x7e66
movq %r15, %rdi
callq 0x7e66
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7e66
movq (%rbx), %rdi
callq 0x7e66
leaq 0xb7eb(%rip), %rdi      # 0x14298
jmp 0x89f8