In glycolysis 4 ATP and 2NADH2 molecules are formed. These 2NADH2 molecules go to electron transport chain.
In oxidative decarboxylation no ATP molecule is formed but two molecules of NADH2 are formed from two molecules of pyruvate. These two NADH2 go to electron transport chain. In Krebs cycle 2ATP,6NADH2 and 2FADH2 molecules are formed from two molecule of acetyl Co-A. These NADH2 and FADH2 go to electron transport chain. In electron transport chain all NADH2 and FADH2 pass to electron carriers and yield 3ATP and 2ATP molecules per NADH2 and FADH2 respectively.
Thus, 4ATP are formed in glycolysis 2ATP in Krebs cycle and 34ATP from electron transport chain 40ATP 2ATP molecules are used during glycolysis.
So, net gain of ATP molecules during one complete oxidation of a glucose molecule is 38ATP.