How can I make this VB.NET code more efficient and faster?
===

I've been trying to make this code faster and more efficient for a few days now, but it still doesn't seem as efficient as it could be. 

This is the code: http://pastebin.com/tin3xrNY

It currently runs 100 iterations of i in 4.3 milliseconds.
I feel like the nested if statements are the main bottleneck here, but I'm not sure of any way I can change them.

So, can this code be made more efficient?

Thanks... :)

