Stabilize mode code

Hi all!. Can anyone help me to find code that describes dependence motor’s thrust of gyro and accel values in stabilize mode? I found something similar at AP_MotorsTri::output_armed_stabilizing(), but without gyro and accel values. I’d like to understand stabilize algorithm used here.