Brushless motors that use 3 hall sensors to provide position feedback to the control are generally controlled by "trapezoidal" (also called "6 step") commutation schemes. The reason it is sometimes called 6 step commutation is because the 3 hall sensors go through 6 different states for every electrical revolution of the motor. Note that I said electrical revolution, not mechanical revolution. Every time your rotor rotates from a north to south pole and back to a north pole, that is 1 electrical revolution. So on a 2 pole motor, the 1 mechanical revolutions equals 1 electrical revolution. But on a 4 pole motor, 1 mechanical revolution equals 2 electrical revolutions. In general, you can say that for every mechanical revolution the rotor will rotate (the number of poles divided by two) electrical revolutions.
In a motor with 9 stator slots and 12 magnet poles, the number of electrical revolutions in 1 mechanical revolution will be 12 / 2 = 6. And since there are 6 steps in every electrical revolution, you will have 6 x 6 = 36 steps in every mechanical revolution. Since the motor you are adapting this code to is also a 12 pole motor, it will also have 36 steps for every mechanical revolution. (I will note, though, that a 12 pole, 14 stator slot motor isn't going to work if the motor has 3 phases. For a 3 phase motor, you need a multiple of 3 for your number of stator slots. Are you sure you don't mean 14 pole, 12 stator slot? If so, then you will have 7 x 6 = 42 steps.)
Also note that this is a different concept than the number of cogs per revolution. If you rotate the motor by hand and feel it cog, the number of cogs per revolution is going to depend on both the number of magnet poles and the number of stator slots. The # of cogs per revolution is equal to the least common multiple of the number of poles and the number of stator slots.