you do know whether you gain or lose weight has to do with calories consumed? 100 calories of american bread is no different weight gain wise versus 100 calories of french bread.
Calorie counts are typically adjusted; manufacturers don't typically just toss a bag of, say, Ho-Hos in a bomb calorimeter and use the raw numbers from Igor or whatever recording program happens to be around.
The usual macronutrient values (9kcal/g fat, 5 kcal/g EtOH, 4kcal/g carbs and protein) are surprisingly decently calibrated for metabolic inefficiencies.
They do not, however, take into account hormonal responses, which are probably quite a bit more important than once assumed. So there's that.
Actually, that's a myth.[1] It isn't that simple. For example, a calorie of protein is harder to digest, and gets converted to energy less efficiently, than a calorie of carbohydrate.