// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movl %edi, 0x34(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq (%rax), %rax
movl (%rax), %eax
cmpl 0x34(%rsp), %eax
jne 0xd31b
movl 0x34(%rsp), %edi
movq 0x28(%rsp), %rax
movq (%rax), %rsi
addq $0x8, %rsi
movq 0x20(%rsp), %rdx
callq 0xd2c0
movl 0x34(%rsp), %edi
movq 0x28(%rsp), %rax
movq (%rax), %rsi
addq $0x10, %rsi
movq 0x20(%rsp), %rdx
callq 0xd2c0
jmp 0xd532
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl (%rax), %eax
cmpl 0x34(%rsp), %eax
jne 0xd35f
movl 0x34(%rsp), %edi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rax
movq (%rax), %rdx
addq $0x8, %rdx
callq 0xd2c0
movl 0x34(%rsp), %edi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rax
movq (%rax), %rdx
addq $0x10, %rdx
callq 0xd2c0
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rcx
cmpq (%rcx), %rax
jne 0xd376
jmp 0xd532
movq 0x28(%rsp), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, 0x4(%rsp)
subl $0x1, %eax
je 0xd39d
jmp 0xd38b
movl 0x4(%rsp), %eax
subl $0x2, %eax
je 0xd468
jmp 0xd530
movq 0x28(%rsp), %rax
movq (%rax), %rax
movl (%rax), %edi
movq 0x28(%rsp), %rsi
movq 0x28(%rsp), %rdx
callq 0xd2c0
movq 0x28(%rsp), %rax
movq (%rax), %rdi
callq 0xba40
movq %rax, %rsi
movl $0x3, %edi
callq 0x6890
movq %rax, %rdi
callq 0xd540
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rdi
callq 0xba40
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xdcb0
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %rdi
callq 0x7dd0
cmpl $0x0, %eax
je 0xd445
movq 0x28(%rsp), %rax
movq (%rax), %rdi
callq 0xbb90
leaq 0xbdf2(%rip), %rdi      # 0x19218
callq 0x6840
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, (%rax)
movl 0xd978(%rip), %eax      # 0x1adb4
addl $0x1, %eax
movl %eax, 0xd96f(%rip)      # 0x1adb4
movq 0x8(%rsp), %rdi
callq 0xbb90
movq 0x10(%rsp), %rdi
callq 0xbb90
movq 0x18(%rsp), %rdi
callq 0xbb90
jmp 0xd532
movq 0x28(%rsp), %rax
movq (%rax), %rax
movl (%rax), %edi
movq 0x28(%rsp), %rsi
movq 0x28(%rsp), %rdx
callq 0xd2c0
movq 0x28(%rsp), %rax
movq (%rax), %rdi
callq 0xba40
movq %rax, %rsi
movl $0x3, %edi
callq 0x6890
movq %rax, %rdi
callq 0xd540
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rdi
callq 0xba40
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xdec0
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %rdi
callq 0xf770
cmpl $0x0, %eax
je 0xd510
movq 0x28(%rsp), %rax
movq (%rax), %rdi
callq 0xbb90
leaq 0xbd97(%rip), %rdi      # 0x19288
callq 0x6840
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, (%rax)
movl 0xd8ad(%rip), %eax      # 0x1adb4
addl $0x1, %eax
movl %eax, 0xd8a4(%rip)      # 0x1adb4
movq 0x8(%rsp), %rdi
callq 0xbb90
movq 0x10(%rsp), %rdi
callq 0xbb90
movq 0x18(%rsp), %rdi
callq 0xbb90
jmp 0xd532
jmp 0xd532
addq $0x38, %rsp
retq
nopw (%rax,%rax)