Cg 1.5 shader and color correction

I was wondering if anyone has a solution to a Cg 1.5 problem. I’m trying to implement this color correction shader on the Unity engine. The engine has its own fullscreen color correction shader (pretty much that one) but in the source of the unity shader it mentions that the Cg code doesn’t compile properly for Direct3D under the Cg SDK 1.5. Their workaround is to write the shader in assembly but I don’t know how to work in assembly and there’s a lot of special cases for shadows to handle in Unity.

Does anyone know of a way to get the Cg code working with the 1.5 SDK or perhaps an alternate algorithm for the color correction shader?