// File: /workspace/github_c_makefile_star2_O3/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 0x961e
addq $0x8, %rsi
movl %ebp, %edi
movq %r14, %rdx
callq 0x95df
movq (%rbx), %rsi
addq $0x10, %rsi
movl %ebp, %edi
movq %r14, %rdx
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x95df
movq (%r14), %rdx
cmpl %ebp, (%rdx)
jne 0x964a
addq $0x8, %rdx
movl %ebp, %edi
movq %rbx, %rsi
callq 0x95df
movq (%r14), %rdx
addq $0x10, %rdx
movl %ebp, %edi
movq %rbx, %rsi
callq 0x95df
movq (%rbx), %rsi
movq (%r14), %rdx
cmpq %rdx, %rsi
je 0x971f
movl (%rsi), %eax
cmpl $0x2, %eax
je 0x972a
cmpl $0x1, %eax
jne 0x971f
movl $0x1, %edi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x95df
movq (%rbx), %rdi
callq 0x88c5
movq %rax, %r15
movl $0x1, %edi
movl $0x18, %esi
callq 0x2180
movl $0x3, (%rax)
movq %r15, 0x8(%rax)
movq %rax, %rdi
callq 0x97f1
leaq 0x10(%rsp), %r15
movq %rax, (%r15)
movq (%r14), %rdi
callq 0x88c5
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r15, %rdi
callq 0x9b96
movq %rax, %r14
movq (%r15), %r15
testq %r15, %r15
je 0x96e9
cmpl $0x7, (%r15)
jne 0x97a4
leaq 0xbba9(%rip), %rax      # 0x15288
cmpq %rax, 0x8(%r15)
jne 0x97a4
movq (%rbx), %rdi
callq 0x8968
movl $0x1, %edi
movl $0x18, %esi
callq 0x2180
movl $0x7, (%rax)
leaq 0xbb0b(%rip), %rcx      # 0x15218
movq %rcx, 0x8(%rax)
movq %rax, (%rbx)
incl 0xd69a(%rip)            # 0x16db4
jmp 0x97a4
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x2, %edi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x95df
movq (%rbx), %rdi
callq 0x88c5
movq %rax, %r15
movl $0x1, %edi
movl $0x18, %esi
callq 0x2180
movl $0x3, (%rax)
movq %r15, 0x8(%rax)
movq %rax, %rdi
callq 0x97f1
leaq 0x10(%rsp), %r15
movq %rax, (%r15)
movq (%r14), %rdi
callq 0x88c5
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
movq %r15, %rdi
callq 0x9cf4
movq %rax, %r14
movq (%r15), %r15
testq %r15, %r15
je 0x97a4
cmpl $0x7, (%r15)
jne 0x97a4
leaq 0xba7a(%rip), %rax      # 0x15218
cmpq %rax, 0x8(%r15)
je 0x97c8
movq 0x8(%rsp), %rdi
callq 0x8968
movq %r15, %rdi
callq 0x8968
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x8968
movq (%rbx), %rdi
callq 0x8968
movl $0x1, %edi
movl $0x18, %esi
callq 0x2180
movl $0x7, (%rax)
leaq 0xba9c(%rip), %rcx      # 0x15288
jmp 0x970d