Problem with modulo (%) and reset

Testing the ldiv() assumption; I am not able to hang this minimal code , "so ldiv is clean" (update: not so, see below)

#include <stdlib.h>

void setup() {
}

void loop() {
  unsigned long a, b;
  a= 12345;
  b = 1000;
 ldiv_t d = ldiv(a, b);
}

But I do not see reason why it behaves differently in different state.

Energy consumption? speed in which a (reset) capacitor loads/empties? (all assumptions)