simplifying function to be generated by LLVM