Please read the following table in HTML format from a webpage and then answer the question in detail according to the table. Each table cell is defined by a <td> and a </td> tag. Each table row starts with a <tr> and ends with a </tr> tag. 'rowspan=m' and 'colspan=n' represents a cell spaning over 'm' rows and 'n' columns.

Webpage title:
BMW 5 Series (E34)
Table title:
Petrol
Table:
<table id='hittask' contenteditable='False'>
<tr> <th colspan=1 rowspan=1 > Model </th><th colspan=1 rowspan=1 > Years </th><th colspan=1 rowspan=1 > Engine </th><th colspan=1 rowspan=1 > Power </th><th colspan=1 rowspan=1 > Torque </th></tr>
<tr> <td colspan=1 rowspan=2 > 518i </td><td colspan=1 rowspan=1 > 1989–1994 </td><td colspan=1 rowspan=1 > M40B18 4-cyl </td><td colspan=1 rowspan=1 > 83 kW (111 hp) at 5,500 rpm </td><td colspan=1 rowspan=1 > 165 N⋅m (122 lb⋅ft) at 4,250 rpm </td></tr>
<tr> <td colspan=1 rowspan=1 > 1994–1996 </td><td colspan=1 rowspan=1 > M43B18 4-cyl </td><td colspan=1 rowspan=1 > 85 kW (114 hp) at 5,500 rpm </td><td colspan=1 rowspan=1 > 168 N⋅m (124 lb⋅ft) at 3,900 rpm </td></tr>
<tr> <td colspan=1 rowspan=3 > 520i </td><td colspan=1 rowspan=1 > 1988-1990 </td><td colspan=1 rowspan=1 > M20B20 6-cyl </td><td colspan=1 rowspan=1 > 95 kW (127 hp) at 6,000 rpm </td><td colspan=1 rowspan=1 > 174 N⋅m (128 lb⋅ft) at 4,000 rpm </td></tr>
<tr> <td colspan=1 rowspan=1 > 1989-1992 </td><td colspan=1 rowspan=1 > M50B20 6-cyl </td><td colspan=1 rowspan=1 > 110 kW (148 hp) at 6,000 rpm </td><td colspan=1 rowspan=1 > 190 N⋅m (140 lb⋅ft) at 4,700 rpm </td></tr>
<tr> <td colspan=1 rowspan=1 > 1992-1996 </td><td colspan=1 rowspan=1 > M50B20TU 6-cyl </td><td colspan=1 rowspan=1 > 110 kW (148 hp) at 5,900 rpm </td><td colspan=1 rowspan=1 > 190 N⋅m (140 lb⋅ft) at 4,200 rpm </td></tr>
<tr> <td colspan=1 rowspan=3 > 525i </td><td colspan=1 rowspan=1 > 1988-1991 </td><td colspan=1 rowspan=1 > M20B25 6-cyl </td><td colspan=1 rowspan=1 > 125 kW (168 hp) at 5,800 rpm </td><td colspan=1 rowspan=1 > 222 N⋅m (164 lb⋅ft) at 4,300 rpm </td></tr>
<tr> <td colspan=1 rowspan=1 > 1991-1992 </td><td colspan=1 rowspan=1 > M50B25 6-cyl </td><td colspan=1 rowspan=1 > 141 kW (189 hp) at 6,000 rpm </td><td colspan=1 rowspan=1 > 245 N⋅m (181 lb⋅ft) at 4,700 rpm </td></tr>
<tr> <td colspan=1 rowspan=1 > 1992-1996 </td><td colspan=1 rowspan=1 > M50B25TU 6-cyl </td><td colspan=1 rowspan=1 > 141 kW (189 hp) at 5,900 rpm </td><td colspan=1 rowspan=1 > 250 N⋅m (184 lb⋅ft) at 4,200 rpm </td></tr>
<tr> <td colspan=1 rowspan=2 > 530i </td><td colspan=1 rowspan=1 > 1988-1991 </td><td colspan=1 rowspan=1 > M30B30 6-cyl </td><td colspan=1 rowspan=1 > 138 kW (185 hp) at 5,500 rpm </td><td colspan=1 rowspan=1 > 260 N⋅m (192 lb⋅ft) at 4,300 rpm </td></tr>
<tr> <td colspan=1 rowspan=1 > 1992-1996 </td><td colspan=1 rowspan=1 > M60B30 V8 </td><td colspan=1 rowspan=1 > 160 kW (215 hp) at 5,800 rpm </td><td colspan=1 rowspan=1 > 290 N⋅m (214 lb⋅ft) at 4,500 rpm </td></tr>
<tr> <td colspan=1 rowspan=1 > 535i </td><td colspan=1 rowspan=1 > 1987-1992 </td><td colspan=1 rowspan=1 > M30B35 6-cyl </td><td colspan=1 rowspan=1 > 155 kW (208 hp) at 5,700 rpm </td><td colspan=1 rowspan=1 > 305 N⋅m (225 lb⋅ft) at 4,000 rpm </td></tr>
<tr> <td colspan=1 rowspan=1 > 540i </td><td colspan=1 rowspan=1 > 1992–1996 </td><td colspan=1 rowspan=1 > M60B40 V8 </td><td colspan=1 rowspan=1 > 210 kW (282 hp) at 5,800 rpm </td><td colspan=1 rowspan=1 > 400 N⋅m (295 lb⋅ft) at 4,500 rpm </td></tr>
<tr> <td class="highlighted"  colspan=1 rowspan=2 > M5 </td><td colspan=1 rowspan=1 > 1988–1992 </td><td class="highlighted"  colspan=1 rowspan=1 > S38B36 6-cyl </td><td class="highlighted"  colspan=1 rowspan=1 > 232 kW (311 hp) at 6,900 rpm </td><td colspan=1 rowspan=1 > 360 N⋅m (266 lb⋅ft) at 4,750 rpm </td></tr>
<tr> <td colspan=1 rowspan=1 > 1992–1996 </td><td class="highlighted"  colspan=1 rowspan=1 > S38B38 6-cyl </td><td class="highlighted"  colspan=1 rowspan=1 > 250 kW (335 hp) at 6,900 rpm </td><td colspan=1 rowspan=1 > 400 N⋅m (295 lb⋅ft) at 4,750 rpm </td></tr>
</table>
Question:
In what engine type was the E34 M5 originally available and what was the power output before and after upgrades?
Answer:
The E34 M5 was originally available in an S38 6-cyl engine with an output of 232 kW (311 hp) and later upgraded to produce 250 kW (335 hp).