based on pooler's cpuminer