// File: /workspace/github_c_makefile_star2_O2/saltyJeff[P]uClibcpp/extra/config/./expr.c
// Function: expr_eliminate_yn
struct expr *expr_eliminate_yn(struct expr *e)
{
	struct expr *tmp;

	if (e) switch (e->type) {
	case E_AND:
		e->left.expr = expr_eliminate_yn(e->left.expr);
		e->right.expr = expr_eliminate_yn(e->right.expr);
		if (e->left.expr->type == E_SYMBOL) {
			if (e->left.expr->left.sym == &symbol_no) {
				expr_free(e->left.expr);
				expr_free(e->right.expr);
				e->type = E_SYMBOL;
				e->left.sym = &symbol_no;
				e->right.expr = NULL;
				return e;
			} else if (e->left.expr->left.sym == &symbol_yes) {
				free(e->left.expr);
				tmp = e->right.expr;
				*e = *(e->right.expr);
				free(tmp);
				return e;
			}
		}
		if (e->right.expr->type == E_SYMBOL) {
			if (e->right.expr->left.sym == &symbol_no) {
				expr_free(e->left.expr);
				expr_free(e->right.expr);
				e->type = E_SYMBOL;
				e->left.sym = &symbol_no;
				e->right.expr = NULL;
				return e;
			} else if (e->right.expr->left.sym == &symbol_yes) {
				free(e->right.expr);
				tmp = e->left.expr;
				*e = *(e->left.expr);
				free(tmp);
				return e;
			}
		}
		break;
	case E_OR:
		e->left.expr = expr_eliminate_yn(e->left.expr);
		e->right.expr = expr_eliminate_yn(e->right.expr);
		if (e->left.expr->type == E_SYMBOL) {
			if (e->left.expr->left.sym == &symbol_no) {
				free(e->left.expr);
				tmp = e->right.expr;
				*e = *(e->right.expr);
				free(tmp);
				return e;
			} else if (e->left.expr->left.sym == &symbol_yes) {
				expr_free(e->left.expr);
				expr_free(e->right.expr);
				e->type = E_SYMBOL;
				e->left.sym = &symbol_yes;
				e->right.expr = NULL;
				return e;
			}
		}
		if (e->right.expr->type == E_SYMBOL) {
			if (e->right.expr->left.sym == &symbol_no) {
				free(e->right.expr);
				tmp = e->left.expr;
				*e = *(e->left.expr);
				free(tmp);
				return e;
			} else if (e->right.expr->left.sym == &symbol_yes) {
				expr_free(e->left.expr);
				expr_free(e->right.expr);
				e->type = E_SYMBOL;
				e->left.sym = &symbol_yes;
				e->right.expr = NULL;
				return e;
			}
		}
		break;
	default:
		;
	}
	return e;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
je 0x8182
movl (%rbx), %eax
cmpl $0x1, %eax
je 0x80a6
cmpl $0x2, %eax
jne 0x8182
movq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x8008
movq %r14, 0x8(%rbx)
movq 0x10(%rbx), %r14
movq %r14, %rdi
callq 0x8008
movq %r14, 0x10(%rbx)
movq 0x8(%rbx), %rdi
cmpl $0x7, (%rdi)
leaq 0xc1cd(%rip), %r15      # 0x14228
jne 0x807a
movq 0x8(%rdi), %rax
cmpq %r15, %rax
je 0x812b
leaq 0xc227(%rip), %rcx      # 0x14298
cmpq %rcx, %rax
je 0x814a
cmpl $0x7, (%r14)
jne 0x8182
movq 0x8(%r14), %rax
cmpq %r15, %rax
je 0x812b
leaq 0xc200(%rip), %rcx      # 0x14298
cmpq %rcx, %rax
jne 0x8182
jmp 0x8163
movq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x8008
movq %r14, 0x8(%rbx)
movq 0x10(%rbx), %r14
movq %r14, %rdi
callq 0x8008
movq %r14, 0x10(%rbx)
movq 0x8(%rbx), %rdi
cmpl $0x7, (%rdi)
jne 0x80eb
movq 0x8(%rdi), %rax
leaq 0xc14e(%rip), %rcx      # 0x14228
cmpq %rcx, %rax
je 0x814a
leaq 0xc1b2(%rip), %r15      # 0x14298
cmpq %r15, %rax
je 0x812b
cmpl $0x7, (%r14)
jne 0x8182
movq 0x8(%r14), %rax
leaq 0xc128(%rip), %rcx      # 0x14228
cmpq %rcx, %rax
je 0x8163
leaq 0xc18c(%rip), %r14      # 0x14298
cmpq %r14, %rax
jne 0x8182
callq 0x7e66
movq 0x10(%rbx), %rdi
callq 0x7e66
movl $0x7, (%rbx)
movq %r14, 0x8(%rbx)
jmp 0x8143
callq 0x7e66
movq 0x10(%rbx), %rdi
callq 0x7e66
movl $0x7, (%rbx)
movq %r15, 0x8(%rbx)
andq $0x0, 0x10(%rbx)
jmp 0x8182
callq 0x2040
movq 0x10(%rbx), %rdi
movups (%rdi), %xmm0
movups %xmm0, (%rbx)
movq 0x10(%rdi), %rax
movq %rax, 0x10(%rbx)
jmp 0x817d
movq %r14, %rdi
callq 0x2040
movq 0x8(%rbx), %rdi
movq 0x10(%rdi), %rax
movq %rax, 0x10(%rbx)
movups (%rdi), %xmm0
movups %xmm0, (%rbx)
callq 0x2040
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq