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

	if (!e)
		return NULL;
	switch (e->type) {
	case E_EQUAL:
	case E_UNEQUAL:
	case E_SYMBOL:
	case E_CHOICE:
		break;
	default:
		e->left.expr = expr_transform(e->left.expr);
		e->right.expr = expr_transform(e->right.expr);
	}

	switch (e->type) {
	case E_EQUAL:
		if (e->left.sym->type != S_BOOLEAN)
			break;
		if (e->right.sym == &symbol_no) {
			e->type = E_NOT;
			e->left.expr = expr_alloc_symbol(e->left.sym);
			e->right.sym = NULL;
			break;
		}
		if (e->right.sym == &symbol_mod) {
			printf("boolean symbol %s tested for 'm'? test forced to 'n'\n", e->left.sym->name);
			e->type = E_SYMBOL;
			e->left.sym = &symbol_no;
			e->right.sym = NULL;
			break;
		}
		if (e->right.sym == &symbol_yes) {
			e->type = E_SYMBOL;
			e->right.sym = NULL;
			break;
		}
		break;
	case E_UNEQUAL:
		if (e->left.sym->type != S_BOOLEAN)
			break;
		if (e->right.sym == &symbol_no) {
			e->type = E_SYMBOL;
			e->right.sym = NULL;
			break;
		}
		if (e->right.sym == &symbol_mod) {
			printf("boolean symbol %s tested for 'm'? test forced to 'y'\n", e->left.sym->name);
			e->type = E_SYMBOL;
			e->left.sym = &symbol_yes;
			e->right.sym = NULL;
			break;
		}
		if (e->right.sym == &symbol_yes) {
			e->type = E_NOT;
			e->left.expr = expr_alloc_symbol(e->left.sym);
			e->right.sym = NULL;
			break;
		}
		break;
	case E_NOT:
		switch (e->left.expr->type) {
		case E_NOT:
			// !!a -> a
			tmp = e->left.expr->left.expr;
			free(e->left.expr);
			free(e);
			e = tmp;
			e = expr_transform(e);
			break;
		case E_EQUAL:
		case E_UNEQUAL:
			// !a='x' -> a!='x'
			tmp = e->left.expr;
			free(e);
			e = tmp;
			e->type = e->type == E_EQUAL ? E_UNEQUAL : E_EQUAL;
			break;
		case E_OR:
			// !(a || b) -> !a && !b
			tmp = e->left.expr;
			e->type = E_AND;
			e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr);
			tmp->type = E_NOT;
			tmp->right.expr = NULL;
			e = expr_transform(e);
			break;
		case E_AND:
			// !(a && b) -> !a || !b
			tmp = e->left.expr;
			e->type = E_OR;
			e->right.expr = expr_alloc_one(E_NOT, tmp->right.expr);
			tmp->type = E_NOT;
			tmp->right.expr = NULL;
			e = expr_transform(e);
			break;
		case E_SYMBOL:
			if (e->left.expr->left.sym == &symbol_yes) {
				// !'y' -> 'n'
				tmp = e->left.expr;
				free(e);
				e = tmp;
				e->type = E_SYMBOL;
				e->left.sym = &symbol_no;
				break;
			}
			if (e->left.expr->left.sym == &symbol_mod) {
				// !'m' -> 'm'
				tmp = e->left.expr;
				free(e);
				e = tmp;
				e->type = E_SYMBOL;
				e->left.sym = &symbol_mod;
				break;
			}
			if (e->left.expr->left.sym == &symbol_no) {
				// !'n' -> 'y'
				tmp = e->left.expr;
				free(e);
				e = tmp;
				e->type = E_SYMBOL;
				e->left.sym = &symbol_yes;
				break;
			}
			break;
		default:
			;
		}
		break;
	default:
		;
	}
	return e;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0xd55f
movq $0x0, 0x20(%rsp)
jmp 0xda48
movq 0x18(%rsp), %rax
movl (%rax), %eax
addl $-0x4, %eax
subl $0x3, %eax
ja 0xd572
jmp 0xd570
jmp 0xd5a6
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0xd540
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0xd540
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rsp), %rax
movl (%rax), %eax
movl %eax, 0xc(%rsp)
subl $0x3, %eax
je 0xd7af
jmp 0xd5bc
movl 0xc(%rsp), %eax
subl $0x4, %eax
je 0xd5d9
jmp 0xd5c7
movl 0xc(%rsp), %eax
subl $0x5, %eax
je 0xd6c4
jmp 0xda3c
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x1, 0x18(%rax)
je 0xd5ed
jmp 0xda3e
movq 0x18(%rsp), %rax
leaq 0xbc1f(%rip), %rcx      # 0x19218
cmpq %rcx, 0x10(%rax)
jne 0xd636
movq 0x18(%rsp), %rax
movl $0x3, (%rax)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x6840
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rax
movq $0x0, 0x10(%rax)
jmp 0xda3e
movq 0x18(%rsp), %rax
leaq 0xbcb6(%rip), %rcx      # 0x192f8
cmpq %rcx, 0x10(%rax)
jne 0xd690
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
leaq 0x86bd(%rip), %rdi      # 0x15d19
movb $0x0, %al
callq 0x20f0
movq 0x18(%rsp), %rax
movl $0x7, (%rax)
movq 0x18(%rsp), %rax
leaq 0xbb9e(%rip), %rcx      # 0x19218
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rax
movq $0x0, 0x10(%rax)
jmp 0xda3e
movq 0x18(%rsp), %rax
leaq 0xbbec(%rip), %rcx      # 0x19288
cmpq %rcx, 0x10(%rax)
jne 0xd6bf
movq 0x18(%rsp), %rax
movl $0x7, (%rax)
movq 0x18(%rsp), %rax
movq $0x0, 0x10(%rax)
jmp 0xda3e
jmp 0xda3e
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
cmpl $0x1, 0x18(%rax)
je 0xd6d8
jmp 0xda3e
movq 0x18(%rsp), %rax
leaq 0xbb34(%rip), %rcx      # 0x19218
cmpq %rcx, 0x10(%rax)
jne 0xd707
movq 0x18(%rsp), %rax
movl $0x7, (%rax)
movq 0x18(%rsp), %rax
movq $0x0, 0x10(%rax)
jmp 0xda3e
movq 0x18(%rsp), %rax
leaq 0xbbe5(%rip), %rcx      # 0x192f8
cmpq %rcx, 0x10(%rax)
jne 0xd761
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
leaq 0x8622(%rip), %rdi      # 0x15d4f
movb $0x0, %al
callq 0x20f0
movq 0x18(%rsp), %rax
movl $0x7, (%rax)
movq 0x18(%rsp), %rax
leaq 0xbb3d(%rip), %rcx      # 0x19288
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rax
movq $0x0, 0x10(%rax)
jmp 0xda3e
movq 0x18(%rsp), %rax
leaq 0xbb1b(%rip), %rcx      # 0x19288
cmpq %rcx, 0x10(%rax)
jne 0xd7aa
movq 0x18(%rsp), %rax
movl $0x3, (%rax)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x6840
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x18(%rsp), %rax
movq $0x0, 0x10(%rax)
jmp 0xda3e
jmp 0xda3e
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, (%rsp)
subl $0x6, %eax
ja 0xda38
movq (%rsp), %rax
leaq 0x2eb6(%rip), %rcx      # 0x1068c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x2040
movq 0x18(%rsp), %rdi
callq 0x2040
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0xd540
movq %rax, 0x18(%rsp)
jmp 0xda3a
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
callq 0x2040
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movl (%rax), %edx
movl $0x4, %ecx
movl $0x5, %eax
cmpl $0x4, %edx
cmovel %eax, %ecx
movq 0x18(%rsp), %rax
movl %ecx, (%rax)
jmp 0xda3a
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movl $0x2, (%rax)
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rsi
movl $0x3, %edi
callq 0x6890
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x10(%rsp), %rax
movl $0x3, (%rax)
movq 0x10(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x18(%rsp), %rdi
callq 0xd540
movq %rax, 0x18(%rsp)
jmp 0xda3a
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movl $0x1, (%rax)
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rsi
movl $0x3, %edi
callq 0x6890
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x10(%rsp), %rax
movl $0x3, (%rax)
movq 0x10(%rsp), %rax
movq $0x0, 0x10(%rax)
movq 0x18(%rsp), %rdi
callq 0xd540
movq %rax, 0x18(%rsp)
jmp 0xda3a
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
leaq 0xb944(%rip), %rcx      # 0x19288
cmpq %rcx, 0x8(%rax)
jne 0xd98c
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
callq 0x2040
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movl $0x7, (%rax)
movq 0x18(%rsp), %rax
leaq 0xb895(%rip), %rcx      # 0x19218
movq %rcx, 0x8(%rax)
jmp 0xda3a
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
leaq 0xb95c(%rip), %rcx      # 0x192f8
cmpq %rcx, 0x8(%rax)
jne 0xd9e1
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
callq 0x2040
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movl $0x7, (%rax)
movq 0x18(%rsp), %rax
leaq 0xb91d(%rip), %rcx      # 0x192f8
movq %rcx, 0x8(%rax)
jmp 0xda3a
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
leaq 0xb827(%rip), %rcx      # 0x19218
cmpq %rcx, 0x8(%rax)
jne 0xda36
movq 0x18(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
callq 0x2040
movq 0x10(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movl $0x7, (%rax)
movq 0x18(%rsp), %rax
leaq 0xb858(%rip), %rcx      # 0x19288
movq %rcx, 0x8(%rax)
jmp 0xda3a
jmp 0xda3a
jmp 0xda3a
jmp 0xda3e
jmp 0xda3e
movq 0x18(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)