// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r14
movq %rsi, %rbx
testq %rdi, %rdi
je 0xaa62
movl %ecx, %ebp
movq %rdi, %r15
movl (%rdi), %esi
movl %ecx, %edi
callq 0xa965
testl %eax, %eax
jle 0xaa0f
leaq 0x71fc(%rip), %rsi      # 0x11c06
movq %r14, %rdi
callq *%rbx
movl (%r15), %edx
leal -0x1(%rdx), %eax
cmpl $0x7, %eax
ja 0xabac
leaq 0x1bdb(%rip), %rcx      # 0xc600
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl $0x1, %ecx
callq 0xa9da
leaq 0x7131(%rip), %rsi      # 0x11b7a
movq %r14, %rdi
callq *%rbx
movq 0x10(%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl $0x1, %ecx
jmp 0xab65
leaq 0x16f8(%rip), %rsi      # 0xc161
jmp 0xab9a
movq 0x8(%r15), %rax
movq 0x8(%rax), %rsi
movq %r14, %rdi
callq *%rbx
leaq 0x7191(%rip), %rsi      # 0x11c13
jmp 0xaab8
leaq 0x7186(%rip), %rsi      # 0x11c11
movq %r14, %rdi
callq *%rbx
movq 0x8(%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl $0x3, %ecx
jmp 0xab65
movq 0x8(%r15), %rax
movq 0x8(%rax), %rsi
movq %r14, %rdi
callq *%rbx
leaq 0x715c(%rip), %rsi      # 0x11c14
movq %r14, %rdi
callq *%rbx
movq 0x10(%r15), %rax
movq 0x8(%rax), %rsi
jmp 0xab80
leaq 0x7149(%rip), %rsi      # 0x11c1a
movq %r14, %rdi
callq *%rbx
movq 0x8(%r15), %rax
movq 0x8(%rax), %rsi
movq %r14, %rdi
callq *%rbx
leaq 0x6c43(%rip), %rsi      # 0x1172d
movq %r14, %rdi
callq *%rbx
movq 0x10(%r15), %rax
movq 0x8(%rax), %rsi
movq %r14, %rdi
callq *%rbx
leaq 0x7119(%rip), %rsi      # 0x11c1c
jmp 0xab80
movq 0x8(%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl $0x2, %ecx
callq 0xa9da
leaq 0x705f(%rip), %rsi      # 0x11b7f
movq %r14, %rdi
callq *%rbx
movq 0x10(%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl $0x2, %ecx
jmp 0xab65
movq 0x10(%r15), %rax
movq 0x8(%rax), %rsi
movq %r14, %rdi
callq *%rbx
cmpq $0x0, 0x8(%r15)
je 0xab85
leaq 0x70c5(%rip), %rsi      # 0x11c16
movq %r14, %rdi
callq *%rbx
movq 0x8(%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl $0x6, %ecx
callq 0xa9da
jmp 0xab85
movq 0x8(%r15), %rax
movq 0x8(%rax), %rsi
testq %rsi, %rsi
jne 0xab80
leaq 0x7088(%rip), %rsi      # 0x11c08
movq %r14, %rdi
callq *%rbx
movl (%r15), %esi
movl %ebp, %edi
callq 0xa965
testl %eax, %eax
jle 0xab9f
leaq 0x6c09(%rip), %rsi      # 0x117a3
movq %r14, %rdi
callq *%rbx
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x706b(%rip), %rsi      # 0x11c1e
movq %rsp, %r12
movq %r12, %rdi
xorl %eax, %eax
callq 0x22c0
movq %r14, %rdi
movq %r12, %rsi
jmp 0xab83