// File: /workspace/github_c_makefile_star2_O3/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 0xa2a5
movl %ecx, %ebp
movq %rdi, %r14
movq %rax, %r13
movl (%rdi), %r15d
movl %ecx, %edi
movl %r15d, %esi
callq 0xa19c
testl %eax, %eax
jle 0xa253
leaq 0x699c(%rip), %rsi      # 0x10be6
movq %rbx, %rdi
callq *%r13
movl (%r14), %r15d
leal -0x1(%r15), %eax
cmpl $0x7, %eax
ja 0xa40c
leaq 0x1379(%rip), %rcx      # 0xb5e0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%r14), %rdi
movq %r13, %rsi
movq %rbx, %rdx
movl $0x1, %ecx
callq 0xa211
leaq 0x68cf(%rip), %rsi      # 0x10b5a
movq %rbx, %rdi
callq *%r13
movq 0x10(%r14), %rdi
movq %r13, %rsi
movq %rbx, %rdx
movl $0x1, %ecx
jmp 0xa3c1
leaq 0xea9(%rip), %rsi       # 0xb155
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 0x691f(%rip), %rsi      # 0x10bf3
jmp 0xa30c
leaq 0x6914(%rip), %rsi      # 0x10bf1
movq %rbx, %rdi
callq *%r13
movq 0x8(%r14), %rdi
movq %r13, %rsi
movq %rbx, %rdx
movl $0x3, %ecx
jmp 0xa3c1
movq 0x8(%r14), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq *%r13
leaq 0x68e8(%rip), %rsi      # 0x10bf4
movq %rbx, %rdi
callq *%r13
movq 0x10(%r14), %rax
movq 0x8(%rax), %rsi
jmp 0xa3dc
leaq 0x68d4(%rip), %rsi      # 0x10bfa
movq %rbx, %rdi
callq *%r13
movq 0x8(%r14), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq *%r13
leaq 0x63cc(%rip), %rsi      # 0x1070d
movq %rbx, %rdi
callq *%r13
movq 0x10(%r14), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq *%r13
leaq 0x68a0(%rip), %rsi      # 0x10bfc
jmp 0xa3dc
movq 0x8(%r14), %rdi
movq %r13, %rsi
movq %rbx, %rdx
movl $0x2, %ecx
callq 0xa211
leaq 0x67e6(%rip), %rsi      # 0x10b5f
movq %rbx, %rdi
callq *%r13
movq 0x10(%r14), %rdi
movq %r13, %rsi
movq %rbx, %rdx
movl $0x2, %ecx
jmp 0xa3c1
movq 0x10(%r14), %rax
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq *%r13
cmpq $0x0, 0x8(%r14)
je 0xa3e2
leaq 0x684a(%rip), %rsi      # 0x10bf6
movq %rbx, %rdi
callq *%r13
movq 0x8(%r14), %rdi
movq %r13, %rsi
movq %rbx, %rdx
movl $0x6, %ecx
callq 0xa211
jmp 0xa3e2
movq 0x8(%r14), %rax
movq 0x8(%rax), %rsi
testq %rsi, %rsi
jne 0xa3dc
leaq 0x680c(%rip), %rsi      # 0x10be8
movq %rbx, %rdi
callq *%r13
movl (%r14), %esi
movl %ebp, %edi
callq 0xa19c
testl %eax, %eax
jle 0xa3fd
leaq 0x638c(%rip), %rsi      # 0x10783
movq %rbx, %rdi
callq *%r13
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x67eb(%rip), %rsi      # 0x10bfe
movq %rsp, %r12
movq %r12, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x22d0
movq %rbx, %rdi
movq %r12, %rsi
jmp 0xa3df