// File: /workspace/github_c_makefile_star2_O0/saltyJeff[P]uClibcpp/extra/config/./expr.c
// Function: expr_join_or
struct expr *expr_join_or(struct expr *e1, struct expr *e2)
{
	struct expr *tmp;
	struct symbol *sym1, *sym2;

	if (expr_eq(e1, e2))
		return expr_copy(e1);
	if (e1->type != E_EQUAL && e1->type != E_UNEQUAL && e1->type != E_SYMBOL && e1->type != E_NOT)
		return NULL;
	if (e2->type != E_EQUAL && e2->type != E_UNEQUAL && e2->type != E_SYMBOL && e2->type != E_NOT)
		return NULL;
	if (e1->type == E_NOT) {
		tmp = e1->left.expr;
		if (tmp->type != E_EQUAL && tmp->type != E_UNEQUAL && tmp->type != E_SYMBOL)
			return NULL;
		sym1 = tmp->left.sym;
	} else
		sym1 = e1->left.sym;
	if (e2->type == E_NOT) {
		if (e2->left.expr->type != E_SYMBOL)
			return NULL;
		sym2 = e2->left.expr->left.sym;
	} else
		sym2 = e2->left.sym;
	if (sym1 != sym2)
		return NULL;
	if (sym1->type != S_BOOLEAN && sym1->type != S_TRISTATE)
		return NULL;
	if (sym1->type == S_TRISTATE) {
		if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
		    ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_mod) ||
		     (e1->right.sym == &symbol_mod && e2->right.sym == &symbol_yes))) {
			// (a='y') || (a='m') -> (a!='n')
			return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_no);
		}
		if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
		    ((e1->right.sym == &symbol_yes && e2->right.sym == &symbol_no) ||
		     (e1->right.sym == &symbol_no && e2->right.sym == &symbol_yes))) {
			// (a='y') || (a='n') -> (a!='m')
			return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_mod);
		}
		if (e1->type == E_EQUAL && e2->type == E_EQUAL &&
		    ((e1->right.sym == &symbol_mod && e2->right.sym == &symbol_no) ||
		     (e1->right.sym == &symbol_no && e2->right.sym == &symbol_mod))) {
			// (a='m') || (a='n') -> (a!='y')
			return expr_alloc_comp(E_UNEQUAL, sym1, &symbol_yes);
		}
	}
	if (sym1->type == S_BOOLEAN && sym1 == sym2) {
		if ((e1->type == E_NOT && e1->left.expr->type == E_SYMBOL && e2->type == E_SYMBOL) ||
		    (e2->type == E_NOT && e2->left.expr->type == E_SYMBOL && e1->type == E_SYMBOL))
			return expr_alloc_symbol(&symbol_yes);
	}

	printf("optimize ");
	print_expr(0, e1, 0);
	printf(" || ");
	print_expr(0, e2, 0);
	printf(" ?\n");
	return NULL;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0xc350
cmpl $0x0, %eax
je 0xc666
movq 0x28(%rsp), %rdi
callq 0xba40
movq %rax, 0x30(%rsp)
jmp 0xc9fe
movq 0x28(%rsp), %rax
cmpl $0x4, (%rax)
je 0xc69c
movq 0x28(%rsp), %rax
cmpl $0x5, (%rax)
je 0xc69c
movq 0x28(%rsp), %rax
cmpl $0x7, (%rax)
je 0xc69c
movq 0x28(%rsp), %rax
cmpl $0x3, (%rax)
je 0xc69c
movq $0x0, 0x30(%rsp)
jmp 0xc9fe
movq 0x20(%rsp), %rax
cmpl $0x4, (%rax)
je 0xc6d2
movq 0x20(%rsp), %rax
cmpl $0x5, (%rax)
je 0xc6d2
movq 0x20(%rsp), %rax
cmpl $0x7, (%rax)
je 0xc6d2
movq 0x20(%rsp), %rax
cmpl $0x3, (%rax)
je 0xc6d2
movq $0x0, 0x30(%rsp)
jmp 0xc9fe
movq 0x28(%rsp), %rax
cmpl $0x3, (%rax)
jne 0xc726
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpl $0x4, (%rax)
je 0xc716
movq 0x18(%rsp), %rax
cmpl $0x5, (%rax)
je 0xc716
movq 0x18(%rsp), %rax
cmpl $0x7, (%rax)
je 0xc716
movq $0x0, 0x30(%rsp)
jmp 0xc9fe
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0xc734
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rax
cmpl $0x3, (%rax)
jne 0xc76e
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x7, (%rax)
je 0xc75a
movq $0x0, 0x30(%rsp)
jmp 0xc9fe
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
jmp 0xc77c
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x8(%rsp), %rax
je 0xc796
movq $0x0, 0x30(%rsp)
jmp 0xc9fe
movq 0x10(%rsp), %rax
cmpl $0x1, 0x18(%rax)
je 0xc7ba
movq 0x10(%rsp), %rax
cmpl $0x2, 0x18(%rax)
je 0xc7ba
movq $0x0, 0x30(%rsp)
jmp 0xc9fe
movq 0x10(%rsp), %rax
cmpl $0x2, 0x18(%rax)
jne 0xc93f
movq 0x28(%rsp), %rax
cmpl $0x4, (%rax)
jne 0xc845
movq 0x20(%rsp), %rax
cmpl $0x4, (%rax)
jne 0xc845
movq 0x28(%rsp), %rax
leaq 0xca9f(%rip), %rcx      # 0x19288
cmpq %rcx, 0x10(%rax)
jne 0xc801
movq 0x20(%rsp), %rax
leaq 0xcafd(%rip), %rcx      # 0x192f8
cmpq %rcx, 0x10(%rax)
je 0xc825
movq 0x28(%rsp), %rax
leaq 0xcaeb(%rip), %rcx      # 0x192f8
cmpq %rcx, 0x10(%rax)
jne 0xc845
movq 0x20(%rsp), %rax
leaq 0xca69(%rip), %rcx      # 0x19288
cmpq %rcx, 0x10(%rax)
jne 0xc845
movq 0x10(%rsp), %rsi
movl $0x5, %edi
leaq 0xc9e2(%rip), %rdx      # 0x19218
callq 0x63b0
movq %rax, 0x30(%rsp)
jmp 0xc9fe
movq 0x28(%rsp), %rax
cmpl $0x4, (%rax)
jne 0xc8c1
movq 0x20(%rsp), %rax
cmpl $0x4, (%rax)
jne 0xc8c1
movq 0x28(%rsp), %rax
leaq 0xca23(%rip), %rcx      # 0x19288
cmpq %rcx, 0x10(%rax)
jne 0xc87d
movq 0x20(%rsp), %rax
leaq 0xc9a1(%rip), %rcx      # 0x19218
cmpq %rcx, 0x10(%rax)
je 0xc8a1
movq 0x28(%rsp), %rax
leaq 0xc98f(%rip), %rcx      # 0x19218
cmpq %rcx, 0x10(%rax)
jne 0xc8c1
movq 0x20(%rsp), %rax
leaq 0xc9ed(%rip), %rcx      # 0x19288
cmpq %rcx, 0x10(%rax)
jne 0xc8c1
movq 0x10(%rsp), %rsi
movl $0x5, %edi
leaq 0xca46(%rip), %rdx      # 0x192f8
callq 0x63b0
movq %rax, 0x30(%rsp)
jmp 0xc9fe
movq 0x28(%rsp), %rax
cmpl $0x4, (%rax)
jne 0xc93d
movq 0x20(%rsp), %rax
cmpl $0x4, (%rax)
jne 0xc93d
movq 0x28(%rsp), %rax
leaq 0xca17(%rip), %rcx      # 0x192f8
cmpq %rcx, 0x10(%rax)
jne 0xc8f9
movq 0x20(%rsp), %rax
leaq 0xc925(%rip), %rcx      # 0x19218
cmpq %rcx, 0x10(%rax)
je 0xc91d
movq 0x28(%rsp), %rax
leaq 0xc913(%rip), %rcx      # 0x19218
cmpq %rcx, 0x10(%rax)
jne 0xc93d
movq 0x20(%rsp), %rax
leaq 0xc9e1(%rip), %rcx      # 0x192f8
cmpq %rcx, 0x10(%rax)
jne 0xc93d
movq 0x10(%rsp), %rsi
movl $0x5, %edi
leaq 0xc95a(%rip), %rdx      # 0x19288
callq 0x63b0
movq %rax, 0x30(%rsp)
jmp 0xc9fe
jmp 0xc93f
movq 0x10(%rsp), %rax
cmpl $0x1, 0x18(%rax)
jne 0xc9af
movq 0x10(%rsp), %rax
cmpq 0x8(%rsp), %rax
jne 0xc9af
movq 0x28(%rsp), %rax
cmpl $0x3, (%rax)
jne 0xc978
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x7, (%rax)
jne 0xc978
movq 0x20(%rsp), %rax
cmpl $0x7, (%rax)
je 0xc99a
movq 0x20(%rsp), %rax
cmpl $0x3, (%rax)
jne 0xc9ad
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x7, (%rax)
jne 0xc9ad
movq 0x28(%rsp), %rax
cmpl $0x7, (%rax)
jne 0xc9ad
leaq 0xc8e7(%rip), %rdi      # 0x19288
callq 0x6840
movq %rax, 0x30(%rsp)
jmp 0xc9fe
jmp 0xc9af
leaq 0x934f(%rip), %rdi      # 0x15d05
movb $0x0, %al
callq 0x20f0
movq 0x28(%rsp), %rsi
xorl %edx, %edx
movl %edx, %edi
callq 0xc520
leaq 0x933d(%rip), %rdi      # 0x15d0f
movb $0x0, %al
callq 0x20f0
movq 0x20(%rsp), %rsi
xorl %edx, %edx
movl %edx, %edi
callq 0xc520
leaq 0x9313(%rip), %rdi      # 0x15d01
movb $0x0, %al
callq 0x20f0
movq $0x0, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax,%rax)