The stock report must always show its count. Its debug line belongs inside the SHOW_DEBUG block; the ordinary line belongs after #endif. The starter defines SHOW_DEBUG for this run.
#ifdef SHOW_DEBUG and #endif to print Debug stock: 6 only while the name is defined. Always print Stock: 6 afterward. With the supplied definition, the output has those two lines in that order.Put the debug printf between #ifdef SHOW_DEBUG and #endif; put the other printf below.