Some developers use "obfuscators" to intentionally scramble the bytecode, making it nearly impossible for a decompiler to produce logical output.
(available upon request) Appendix B: Bytecode Instruction Map for Lua 5.4 luac decompiler
Finally, the tool prints the reconstructed source code, indenting it based on the control flow analysis. luac decompiler