// File: /workspace/github_c_makefile_star2_O1/saltyJeff[P]uClibcpp/extra/config/./expr.c
// Function: expr_calc_value
tristate expr_calc_value(struct expr *e)
{
	tristate val1, val2;
	const char *str1, *str2;

	if (!e)
		return yes;

	switch (e->type) {
	case E_SYMBOL:
		sym_calc_value(e->left.sym);
		return e->left.sym->curr.tri;
	case E_AND:
		val1 = expr_calc_value(e->left.expr);
		val2 = expr_calc_value(e->right.expr);
		return E_AND(val1, val2);
	case E_OR:
		val1 = expr_calc_value(e->left.expr);
		val2 = expr_calc_value(e->right.expr);
		return E_OR(val1, val2);
	case E_NOT:
		val1 = expr_calc_value(e->left.expr);
		return E_NOT(val1);
	case E_EQUAL:
		sym_calc_value(e->left.sym);
		sym_calc_value(e->right.sym);
		str1 = sym_get_string_value(e->left.sym);
		str2 = sym_get_string_value(e->right.sym);
		return !strcmp(str1, str2) ? yes : no;
	case E_UNEQUAL:
		sym_calc_value(e->left.sym);
		sym_calc_value(e->right.sym);
		str1 = sym_get_string_value(e->left.sym);
		str2 = sym_get_string_value(e->right.sym);
		return !strcmp(str1, str2) ? no : yes;
	default:
		printf("expr_calc_value: %d?\n", e->type);
		return no;
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %r14, %r14
je 0xa805
movl (%r14), %esi
cmpl $0x2, %esi
jne 0xa7c6
movq 0x8(%r14), %rdi
callq 0xa799
movq 0x10(%r14), %r14
cmpl %ebx, %eax
cmovbl %eax, %ebx
jmp 0xa7a5
leal -0x1(%rsi), %eax
cmpl $0x6, %eax
ja 0xa8c2
leaq 0x1df3(%rip), %rcx      # 0xc5cc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%r14), %rdi
callq 0xa799
movl %eax, %ebp
movq 0x10(%r14), %rdi
callq 0xa799
cmpl %eax, %ebp
cmoval %ebp, %eax
cmpl %ebx, %eax
cmovael %ebx, %eax
jmp 0xa960
movl $0x2, %ebp
jmp 0xa959
movq 0x8(%r14), %rdi
callq 0x8244
movq 0x10(%r14), %rdi
callq 0x8244
movq 0x8(%r14), %rax
movl 0x18(%rax), %ecx
decl %ecx
cmpl $0x1, %ecx
ja 0xa8d7
movl 0x28(%rax), %ecx
cmpq $0x3, %rcx
jae 0xa8d7
leaq 0xb551(%rip), %rax      # 0x15d98
leaq (%rax,%rcx,8), %rax
jmp 0xa8db
movq 0x8(%r14), %rdi
callq 0x8244
movq 0x10(%r14), %rdi
callq 0x8244
movq 0x8(%r14), %rax
movl 0x18(%rax), %ecx
decl %ecx
cmpl $0x1, %ecx
ja 0xa918
movl 0x28(%rax), %ecx
cmpq $0x3, %rcx
jae 0xa918
leaq 0xb510(%rip), %rax      # 0x15d98
leaq (%rax,%rcx,8), %rax
jmp 0xa91c
movq 0x8(%r14), %rdi
callq 0xa799
movl $0x2, %ecx
subl %eax, %ecx
cmpl %ebx, %ecx
cmovael %ebx, %ecx
movl %ecx, %eax
jmp 0xa960
movq 0x8(%r14), %rdi
callq 0x8244
movq 0x8(%r14), %rax
movl 0x28(%rax), %ebp
jmp 0xa959
leaq 0x7327(%rip), %rdi      # 0x11bf0
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x2100
jmp 0xa959
addq $0x20, %rax
movq (%rax), %rdi
movq 0x10(%r14), %rax
movl 0x18(%rax), %ecx
decl %ecx
cmpl $0x1, %ecx
ja 0xa902
movl 0x28(%rax), %ecx
cmpq $0x3, %rcx
jae 0xa902
leaq 0xb49c(%rip), %rax      # 0x15d98
leaq (%rax,%rcx,8), %rax
jmp 0xa906
addq $0x20, %rax
movq (%rax), %rsi
callq 0x2180
xorl %ebp, %ebp
testl %eax, %eax
setne %bpl
jmp 0xa957
addq $0x20, %rax
movq (%rax), %rdi
movq 0x10(%r14), %rax
movl 0x18(%rax), %ecx
decl %ecx
cmpl $0x1, %ecx
ja 0xa943
movl 0x28(%rax), %ecx
cmpq $0x3, %rcx
jae 0xa943
leaq 0xb45b(%rip), %rax      # 0x15d98
leaq (%rax,%rcx,8), %rax
jmp 0xa947
addq $0x20, %rax
movq (%rax), %rsi
callq 0x2180
xorl %ebp, %ebp
testl %eax, %eax
sete %bpl
addl %ebp, %ebp
cmpl %ebx, %ebp
cmovbl %ebp, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq