How to transform a multiple digit integer into multiple single digit integers?

OK, one more time, replace reference with local vars and skip one test sometimes.

void splitDigits4(uint16_t in, uint8_t ar[])
{
  uint8_t d = 0, h = 0, t = 0, o;
  if (in >= 8000) {
    in -= 8000;
    d = 8;
  }
  else if (in >= 4000) {
    in -= 4000;
    d = 4;
  }
  if (in >= 2000) {
    in -= 2000;
    d += 2;
  }
  if (in >= 1000) {
    in -= 1000;
    d++;
  }
  if (in >= 800) {
    in -= 800;
    h = 8;
  }
  else if (in >= 400) {
    in -= 400;
    h = 4;
  }
  if (in >= 200) {
    in -= 200;
    h += 2;
  }
  o = in;
  if (o >= 100) {
    o -= 100;
    h++;
  }
  if (o >= 80) {
    o -= 80;
    t = 8;
  }
  else if (o >= 40) {
    o -= 40;
    t = 4;
  }
  if (o >= 20) {
    o -= 20;
    t += 2;
  }
  if (o >= 10) {
    o -= 10;
    t++;
  }
  ar[0] = d;
  ar[1] = h;
  ar[2] = t;
  ar[3] = o;
}

splitDigits10: 237372 uS per 10000 calls
0 0 0 0 0 0 9 9 9 9
2 splitDigits4: 106240 uS per 10000 calls
1 splitDigits4: 56036 uS per 10000 calls
9 8 7 6

50204 uS / 10K calls