OTP solver in C