Python Time Monotonic Stack Problems In C