The weapons system on the US Air Force AC-130U Spooky gunship is regarded as the most complex in current use. Its mission computer software has over 609,000 lines of code and it employs television, radar and infrared sensors to pinpoint targets in all conditions (including night and bad weather). Equipped with a 105 mm tank-sized cannon, a faster-firing 40 mm cannon and a 25 mm Gatling gun, it can simultaneously lock onto two separate targets up to 1 km (0.6 miles) apart. Such firepower makes the AC-130U devastating in its primary role providing close air support to ground troops. It is also equipped with nine separate countermeasures systems to provide protection against attack. The AC-130U saw widespread use in Afghanistan.The AC-130U is essentially an adapted Lockheed C-130 'Hercules' transport aircraft, which is widely used in airforces throughout the world. An earlier version, the AC-130H entered service in 1972, with the 'Spooky' entering service in 1995. The cost per aircraft was US$190 million in 2001.