I guess the loop structure: do { __disable_irq(); } while (0)might have cause the NOPs.Although it didn't expand into a loop, the compiler might have reserved the space for instructions if a loop is needed.And because it is -O0, it didn't remove the unused instruction space and hence NOPs is used.