I encounter this same situation with my work all the time. If you are having debugging problems, there is no way you can get an adequate answer with pseudo code. What you need to do is narrow down to where you think the specific bug is and then post only that portion of the code.
For the content issue, take out anything specific that we really don't need anyway. For example, replace text with a placeholder like the "lorem ipsum" block. Change data values from names and social security numbers to dummy names and numbers.
As long as it is not a problem with a proprietary algorithm (which we would probably not be able to help with anyway) then posting the relevant aspects of the code while removing any company specifics will not run you into legal trouble. A good rule of thumb I use before I post is to ask if I have generalized the content enough that it could apply to several other industries. If so, it won't hurt my organization to share.
Look up How to create a Minimal, Complete, and Verifiable example for more information.