int s;

*k = 0;
while (no>0) {
 count[*k] = analyze(no, s); ←初期化されてないsが使われてる
 no -= (1<<count[(*k)++]);
}