--- tags: decompiler --- # implicit error caused due to adhoc fixes `while` loops follow the following format in python 3.7: original ```pyhton def _kafka_main_consumer(): while a or b: continue ``` result: ```python def _kafka_main_consumer(): while not a: if b: continue ``` ## initial code for `while` `while cond` :`[SETUP_LOOP]<SOME_CONDITION_COMPUTATION>[POP_JUMP_IF_FALSE]` ## catering to `not` operator however `while not var` for one variable will end with `POP_JUMP_IF_TRUE`. An adhoc fix would be to do the following: `while not var` : `[SETUP_LOOP]<LOAD var>[POP_JUMP_IF_TRUE]`. ## impact on `or` chains However, this contradicts with case where conditional chains with `or` operator. Since they follow the following pattern: `while var1 or var2` : `[SETUP_LOOP]<LOAD var1>[POP_JUMP_IF_TRUE]<LOAD var1>[POP_JUMP_IF_FALSE]` this will be translated as now: `while not var1: if var2:` Since now it does contain patterns for `if var` and `while not var`