fixed LLVM for loop to test end condition before looping