LLVM code changes if code is wrapped in function

Thank you so much for you response. This is really helpful. I was banging my head last night trying to figure out what was going on.