// File: /workspace/github_c_makefile_star2_O2/saltyJeff[P]uClibcpp/extra/config/./expr.c
// Function: expr_print
void expr_print(struct expr *e, void (*fn)(void *, const char *), void *data, int prevtoken)
{
	if (!e) {
		fn(data, "y");
		return;
	}

	if (expr_compare_type(prevtoken, e->type) > 0)
		fn(data, "(");
	switch (e->type) {
	case E_SYMBOL:
		if (e->left.sym->name)
			fn(data, e->left.sym->name);
		else
			fn(data, "<choice>");
		break;
	case E_NOT:
		fn(data, "!");
		expr_print(e->left.expr, fn, data, E_NOT);
		break;
	case E_EQUAL:
		fn(data, e->left.sym->name);
		fn(data, "=");
		fn(data, e->right.sym->name);
		break;
	case E_UNEQUAL:
		fn(data, e->left.sym->name);
		fn(data, "!=");
		fn(data, e->right.sym->name);
		break;
	case E_OR:
		expr_print(e->left.expr, fn, data, E_OR);
		fn(data, " || ");
		expr_print(e->right.expr, fn, data, E_OR);
		break;
	case E_AND:
		expr_print(e->left.expr, fn, data, E_AND);
		fn(data, " && ");
		expr_print(e->right.expr, fn, data, E_AND);
		break;
	case E_CHOICE:
		fn(data, e->right.sym->name);
		if (e->left.expr) {
			fn(data, " ^ ");
			expr_print(e->left.expr, fn, data, E_CHOICE);
		}
		break;
	case E_RANGE:
		fn(data, "[");
		fn(data, e->left.sym->name);
		fn(data, " ");
		fn(data, e->right.sym->name);
		fn(data, "]");
		break;
	default:
	  {
		char buf[32];
		sprintf(buf, "<unknown type %d>", e->type);
		fn(data, buf);
		break;
	  }
	}
	if (expr_compare_type(prevtoken, e->type) > 0)
		fn(data, ")");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %rax
testq %rdi, %rdi
je 0x9384
movl %ecx, %ebp
movq %rdi, %r14
movq %rax, %r13
movl (%rdi), %r15d
movl %ecx, %edi
movl %r15d, %esi
callq 0x9292
testl %eax, %eax
jle 0x9345
leaq 0x68de(%rip), %rsi      # 0xfc1a
movq %rbx, %rdi
callq *%r13
movl (%r14), %r15d
leal -0x1(%r15), %eax
cmpl $0x7, %eax
ja 0x94e0
leaq 0x12bb(%rip), %rcx      # 0xa614
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%r14), %rdi
pushq $0x1
popq %r15
movq %r13, %rsi
movq %rbx, %rdx
movl %r15d, %ecx
callq 0x9303
leaq 0x680f(%rip), %rsi      # 0xfb8e
jmp 0x9451
leaq 0xdca(%rip), %rsi       # 0xa155
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
movq 0x8(%r14), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq *%r13
leaq 0x6874(%rip), %rsi      # 0xfc27
jmp 0x93e2
leaq 0x6869(%rip), %rsi      # 0xfc25
movq %rbx, %rdi
callq *%r13
movq 0x8(%r14), %rdi
pushq $0x3
jmp 0x948e
movq 0x8(%r14), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq *%r13
leaq 0x6846(%rip), %rsi      # 0xfc28
movq %rbx, %rdi
callq *%r13
movq 0x10(%r14), %rax
movq 0x8(%rax), %rsi
jmp 0x94b0
leaq 0x6832(%rip), %rsi      # 0xfc2e
movq %rbx, %rdi
callq *%r13
movq 0x8(%r14), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq *%r13
leaq 0x632a(%rip), %rsi      # 0xf741
movq %rbx, %rdi
callq *%r13
movq 0x10(%r14), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq *%r13
leaq 0x67fe(%rip), %rsi      # 0xfc30
jmp 0x94b0
movq 0x8(%r14), %rdi
pushq $0x2
popq %r15
movq %r13, %rsi
movq %rbx, %rdx
movl %r15d, %ecx
callq 0x9303
leaq 0x6742(%rip), %rsi      # 0xfb93
movq %rbx, %rdi
callq *%r13
movq 0x10(%r14), %rdi
movq %r13, %rsi
movq %rbx, %rdx
movl %r15d, %ecx
jmp 0x9495
movq 0x10(%r14), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq *%r13
cmpq $0x0, 0x8(%r14)
je 0x94b6
leaq 0x67a8(%rip), %rsi      # 0xfc2a
movq %rbx, %rdi
callq *%r13
movq 0x8(%r14), %rdi
pushq $0x6
popq %rcx
movq %r13, %rsi
movq %rbx, %rdx
callq 0x9303
jmp 0x94b6
movq 0x8(%r14), %rax
movq 0x8(%rax), %rsi
testq %rsi, %rsi
jne 0x94b0
leaq 0x676c(%rip), %rsi      # 0xfc1c
movq %rbx, %rdi
callq *%r13
movl (%r14), %esi
movl %ebp, %edi
callq 0x9292
testl %eax, %eax
jle 0x94d1
leaq 0x62ec(%rip), %rsi      # 0xf7b7
movq %rbx, %rdi
callq *%r13
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x674b(%rip), %rsi      # 0xfc32
movq %rsp, %r12
movq %r12, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x22e0
movq %rbx, %rdi
movq %r12, %rsi
jmp 0x94b3