// File: /workspace/github_c_makefile_star2_O0/saltyJeff[P]uClibcpp/extra/config/./expr.c
// Function: expr_join_and
struct expr *expr_join_and(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 ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_yes) ||
	    (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_yes))
		// (a) && (a='y') -> (a='y')
		return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);

	if ((e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_no) ||
	    (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_no))
		// (a) && (a!='n') -> (a)
		return expr_alloc_symbol(sym1);

	if (sym1->type == S_TRISTATE) {
		if (e1->type == E_EQUAL && e2->type == E_UNEQUAL) {
			// (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b'
			sym2 = e1->right.sym;
			if ((e2->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST))
				return sym2 != e2->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2)
							     : expr_alloc_symbol(&symbol_no);
		}
		if (e1->type == E_UNEQUAL && e2->type == E_EQUAL) {
			// (a='b') && (a!='c') -> 'b'='c' ? 'n' : a='b'
			sym2 = e2->right.sym;
			if ((e1->right.sym->flags & SYMBOL_CONST) && (sym2->flags & SYMBOL_CONST))
				return sym2 != e1->right.sym ? expr_alloc_comp(E_EQUAL, sym1, sym2)
							     : expr_alloc_symbol(&symbol_no);
		}
		if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
			   ((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_EQUAL, sym1, &symbol_mod);

		if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
			   ((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_EQUAL, sym1, &symbol_no);

		if (e1->type == E_UNEQUAL && e2->type == E_UNEQUAL &&
			   ((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='m')
			return expr_alloc_comp(E_EQUAL, sym1, &symbol_yes);

		if ((e1->type == E_SYMBOL && e2->type == E_EQUAL && e2->right.sym == &symbol_mod) ||
		    (e2->type == E_SYMBOL && e1->type == E_EQUAL && e1->right.sym == &symbol_mod) ||
		    (e1->type == E_SYMBOL && e2->type == E_UNEQUAL && e2->right.sym == &symbol_yes) ||
		    (e2->type == E_SYMBOL && e1->type == E_UNEQUAL && e1->right.sym == &symbol_yes))
			return NULL;
	}
	printf("optimize ");
	print_expr(0, e1, 0);
	printf(" && ");
	print_expr(0, e2, 0);
	printf(" ?\n");
	return NULL;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0xc350
cmpl $0x0, %eax
je 0xca46
movq 0x38(%rsp), %rdi
callq 0xba40
movq %rax, 0x40(%rsp)
jmp 0xd00b
movq 0x38(%rsp), %rax
cmpl $0x4, (%rax)
je 0xca7c
movq 0x38(%rsp), %rax
cmpl $0x5, (%rax)
je 0xca7c
movq 0x38(%rsp), %rax
cmpl $0x7, (%rax)
je 0xca7c
movq 0x38(%rsp), %rax
cmpl $0x3, (%rax)
je 0xca7c
movq $0x0, 0x40(%rsp)
jmp 0xd00b
movq 0x30(%rsp), %rax
cmpl $0x4, (%rax)
je 0xcab2
movq 0x30(%rsp), %rax
cmpl $0x5, (%rax)
je 0xcab2
movq 0x30(%rsp), %rax
cmpl $0x7, (%rax)
je 0xcab2
movq 0x30(%rsp), %rax
cmpl $0x3, (%rax)
je 0xcab2
movq $0x0, 0x40(%rsp)
jmp 0xd00b
movq 0x38(%rsp), %rax
cmpl $0x3, (%rax)
jne 0xcb06
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpl $0x4, (%rax)
je 0xcaf6
movq 0x28(%rsp), %rax
cmpl $0x5, (%rax)
je 0xcaf6
movq 0x28(%rsp), %rax
cmpl $0x7, (%rax)
je 0xcaf6
movq $0x0, 0x40(%rsp)
jmp 0xd00b
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0xcb14
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
cmpl $0x3, (%rax)
jne 0xcb4e
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x7, (%rax)
je 0xcb3a
movq $0x0, 0x40(%rsp)
jmp 0xd00b
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0xcb5c
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x18(%rsp), %rax
je 0xcb76
movq $0x0, 0x40(%rsp)
jmp 0xd00b
movq 0x20(%rsp), %rax
cmpl $0x1, 0x18(%rax)
je 0xcb9a
movq 0x20(%rsp), %rax
cmpl $0x2, 0x18(%rax)
je 0xcb9a
movq $0x0, 0x40(%rsp)
jmp 0xd00b
movq 0x38(%rsp), %rax
cmpl $0x7, (%rax)
jne 0xcbc0
movq 0x30(%rsp), %rax
cmpl $0x4, (%rax)
jne 0xcbc0
movq 0x30(%rsp), %rax
leaq 0xc6ce(%rip), %rcx      # 0x19288
cmpq %rcx, 0x10(%rax)
je 0xcbe6
movq 0x30(%rsp), %rax
cmpl $0x7, (%rax)
jne 0xcc06
movq 0x38(%rsp), %rax
cmpl $0x4, (%rax)
jne 0xcc06
movq 0x38(%rsp), %rax
leaq 0xc6a8(%rip), %rcx      # 0x19288
cmpq %rcx, 0x10(%rax)
jne 0xcc06
movq 0x20(%rsp), %rsi
movl $0x4, %edi
leaq 0xc691(%rip), %rdx      # 0x19288
callq 0x63b0
movq %rax, 0x40(%rsp)
jmp 0xd00b
movq 0x38(%rsp), %rax
cmpl $0x7, (%rax)
jne 0xcc2c
movq 0x30(%rsp), %rax
cmpl $0x5, (%rax)
jne 0xcc2c
movq 0x30(%rsp), %rax
leaq 0xc5f2(%rip), %rcx      # 0x19218
cmpq %rcx, 0x10(%rax)
je 0xcc52
movq 0x30(%rsp), %rax
cmpl $0x7, (%rax)
jne 0xcc66
movq 0x38(%rsp), %rax
cmpl $0x5, (%rax)
jne 0xcc66
movq 0x38(%rsp), %rax
leaq 0xc5cc(%rip), %rcx      # 0x19218
cmpq %rcx, 0x10(%rax)
jne 0xcc66
movq 0x20(%rsp), %rdi
callq 0x6840
movq %rax, 0x40(%rsp)
jmp 0xd00b
movq 0x20(%rsp), %rax
cmpl $0x2, 0x18(%rax)
jne 0xcfbc
movq 0x38(%rsp), %rax
cmpl $0x4, (%rax)
jne 0xcd0c
movq 0x30(%rsp), %rax
cmpl $0x5, (%rax)
jne 0xcd0c
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movl 0x44(%rax), %eax
andl $0x7, %eax
cmpl $0x0, %eax
je 0xcd0a
movq 0x18(%rsp), %rax
movl 0x44(%rax), %eax
andl $0x7, %eax
cmpl $0x0, %eax
je 0xcd0a
movq 0x18(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpq 0x10(%rcx), %rax
je 0xccea
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
movl $0x4, %edi
callq 0x63b0
movq %rax, 0x10(%rsp)
jmp 0xccfb
leaq 0xc527(%rip), %rdi      # 0x19218
callq 0x6840
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0xd00b
jmp 0xcd0c
movq 0x38(%rsp), %rax
cmpl $0x5, (%rax)
jne 0xcda3
movq 0x30(%rsp), %rax
cmpl $0x4, (%rax)
jne 0xcda3
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %rax
movq 0x10(%rax), %rax
movl 0x44(%rax), %eax
andl $0x7, %eax
cmpl $0x0, %eax
je 0xcda1
movq 0x18(%rsp), %rax
movl 0x44(%rax), %eax
andl $0x7, %eax
cmpl $0x0, %eax
je 0xcda1
movq 0x18(%rsp), %rax
movq 0x38(%rsp), %rcx
cmpq 0x10(%rcx), %rax
je 0xcd81
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %rdx
movl $0x4, %edi
callq 0x63b0
movq %rax, 0x8(%rsp)
jmp 0xcd92
leaq 0xc490(%rip), %rdi      # 0x19218
callq 0x6840
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0xd00b
jmp 0xcda3
movq 0x38(%rsp), %rax
cmpl $0x5, (%rax)
jne 0xce1f
movq 0x30(%rsp), %rax
cmpl $0x5, (%rax)
jne 0xce1f
movq 0x38(%rsp), %rax
leaq 0xc4c5(%rip), %rcx      # 0x19288
cmpq %rcx, 0x10(%rax)
jne 0xcddb
movq 0x30(%rsp), %rax
leaq 0xc443(%rip), %rcx      # 0x19218
cmpq %rcx, 0x10(%rax)
je 0xcdff
movq 0x38(%rsp), %rax
leaq 0xc431(%rip), %rcx      # 0x19218
cmpq %rcx, 0x10(%rax)
jne 0xce1f
movq 0x30(%rsp), %rax
leaq 0xc48f(%rip), %rcx      # 0x19288
cmpq %rcx, 0x10(%rax)
jne 0xce1f
movq 0x20(%rsp), %rsi
movl $0x4, %edi
leaq 0xc4e8(%rip), %rdx      # 0x192f8
callq 0x63b0
movq %rax, 0x40(%rsp)
jmp 0xd00b
movq 0x38(%rsp), %rax
cmpl $0x5, (%rax)
jne 0xce9b
movq 0x30(%rsp), %rax
cmpl $0x5, (%rax)
jne 0xce9b
movq 0x38(%rsp), %rax
leaq 0xc449(%rip), %rcx      # 0x19288
cmpq %rcx, 0x10(%rax)
jne 0xce57
movq 0x30(%rsp), %rax
leaq 0xc4a7(%rip), %rcx      # 0x192f8
cmpq %rcx, 0x10(%rax)
je 0xce7b
movq 0x38(%rsp), %rax
leaq 0xc495(%rip), %rcx      # 0x192f8
cmpq %rcx, 0x10(%rax)
jne 0xce9b
movq 0x30(%rsp), %rax
leaq 0xc413(%rip), %rcx      # 0x19288
cmpq %rcx, 0x10(%rax)
jne 0xce9b
movq 0x20(%rsp), %rsi
movl $0x4, %edi
leaq 0xc38c(%rip), %rdx      # 0x19218
callq 0x63b0
movq %rax, 0x40(%rsp)
jmp 0xd00b
movq 0x38(%rsp), %rax
cmpl $0x5, (%rax)
jne 0xcf17
movq 0x30(%rsp), %rax
cmpl $0x5, (%rax)
jne 0xcf17
movq 0x38(%rsp), %rax
leaq 0xc43d(%rip), %rcx      # 0x192f8
cmpq %rcx, 0x10(%rax)
jne 0xced3
movq 0x30(%rsp), %rax
leaq 0xc34b(%rip), %rcx      # 0x19218
cmpq %rcx, 0x10(%rax)
je 0xcef7
movq 0x38(%rsp), %rax
leaq 0xc339(%rip), %rcx      # 0x19218
cmpq %rcx, 0x10(%rax)
jne 0xcf17
movq 0x30(%rsp), %rax
leaq 0xc407(%rip), %rcx      # 0x192f8
cmpq %rcx, 0x10(%rax)
jne 0xcf17
movq 0x20(%rsp), %rsi
movl $0x4, %edi
leaq 0xc380(%rip), %rdx      # 0x19288
callq 0x63b0
movq %rax, 0x40(%rsp)
jmp 0xd00b
movq 0x38(%rsp), %rax
cmpl $0x7, (%rax)
jne 0xcf3d
movq 0x30(%rsp), %rax
cmpl $0x4, (%rax)
jne 0xcf3d
movq 0x30(%rsp), %rax
leaq 0xc3c1(%rip), %rcx      # 0x192f8
cmpq %rcx, 0x10(%rax)
je 0xcfaf
movq 0x30(%rsp), %rax
cmpl $0x7, (%rax)
jne 0xcf63
movq 0x38(%rsp), %rax
cmpl $0x4, (%rax)
jne 0xcf63
movq 0x38(%rsp), %rax
leaq 0xc39b(%rip), %rcx      # 0x192f8
cmpq %rcx, 0x10(%rax)
je 0xcfaf
movq 0x38(%rsp), %rax
cmpl $0x7, (%rax)
jne 0xcf89
movq 0x30(%rsp), %rax
cmpl $0x5, (%rax)
jne 0xcf89
movq 0x30(%rsp), %rax
leaq 0xc305(%rip), %rcx      # 0x19288
cmpq %rcx, 0x10(%rax)
je 0xcfaf
movq 0x30(%rsp), %rax
cmpl $0x7, (%rax)
jne 0xcfba
movq 0x38(%rsp), %rax
cmpl $0x5, (%rax)
jne 0xcfba
movq 0x38(%rsp), %rax
leaq 0xc2df(%rip), %rcx      # 0x19288
cmpq %rcx, 0x10(%rax)
jne 0xcfba
movq $0x0, 0x40(%rsp)
jmp 0xd00b
jmp 0xcfbc
leaq 0x8d42(%rip), %rdi      # 0x15d05
movb $0x0, %al
callq 0x20f0
movq 0x38(%rsp), %rsi
xorl %edx, %edx
movl %edx, %edi
callq 0xc520
leaq 0x8d35(%rip), %rdi      # 0x15d14
movb $0x0, %al
callq 0x20f0
movq 0x30(%rsp), %rsi
xorl %edx, %edx
movl %edx, %edi
callq 0xc520
leaq 0x8d06(%rip), %rdi      # 0x15d01
movb $0x0, %al
callq 0x20f0
movq $0x0, 0x40(%rsp)
movq 0x40(%rsp), %rax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)