(*) Caveat: It must be a small challenge involving a relatively simple task. I don't have a lot of time to waste on this.
Nice caveat. Let me rephrase that another way for you: it is difficult to implement complicated functionality in C. Indeed, this is one reason to use higher level languages. You can achieve more in less time.
1 1 was a race-horse, 2 2 was 1 2. When 1 1 1 1 race, 2 2 1 1 2.