reset_mbytes(state);
status = count_mbytes(buffer, count, state);
if (status >= 0) {
reset_mbytes(state);
if (check_mbytes(wch, buffer, count, state) != status) {
code = ERR; /* the two calls should match */
reset_mbytes(state);
status = count_mbytes(buffer, count, state);
if (status >= 0) {
reset_mbytes(state);
if (check_mbytes(wch, buffer, count, state) != status) {
code = ERR; /* the two calls should match */